src/Model/ResultSet.php
public function getAttribute(string $attributeName) : array
    {
        if ($this->isEmpty()) {
            return [];
        }

        $entries = $this->toArray();
        if (!array_key_exists($attributeName, $entries[0])) {
            throw new InvalidAttributeException($attributeName);
        }

        return array_column($entries, $attributeName);
    }
public function getAttribute(string $attributeName) : array
    {
        if ($this->isEmpty()) {
            return [];
        }

        $entries = $this->toArray();
        if (!array_key_exists($attributeName, $entries[0])) {
            throw new InvalidAttributeException($attributeName);
        }

        return array_column($entries, $attributeName);
    }
public function getAttribute ( string $ attributeName ) : array { if ( $ this -> isEmpty ( ) ) { return [ ] ; } $ entries = $ this -> toArray ( ) ; if ( ! array_key_exists ( $ attributeName , $ entries [ 0 ] ) ) { throw new InvalidAttributeException ( $ attributeName ) ; } return array_column ( $ entries , $ attributeName ) ; }
Returns an array containing the values of a given attribute of each object in the ResultSet

@param string $attributeName Attribute name

@return array
@throws InvalidAttributeException When the attribute is not found on the object
Returns an array containing the values of a given attribute of each object in the ResultSet