JamesMoss\Flywheel\Result::pick PHP Method

pick() public method

Returns an array where each value is a single property from each document. If the property doesnt exist on the document then it won't be in the returned array.
public pick ( string $field ) : array
$field string The name of the field to pick.
return array The array of values, one from each document.
    public function pick($field)
    {
        $result = array();
        foreach ($this->documents as $document) {
            if (isset($document->{$field})) {
                $result[] = $document->{$field};
            }
        }
        return $result;
    }