Google\Cloud\Datastore\Query\Query::projection PHP Method

projection() public method

Accepts an array of properties. If set, only these properties will be returned. Example: $query->projection(['firstName', 'lastName']);
public projection ( array | string $properties ) : Query
$properties array | string The property or properties to include in the result.
return Query
    public function projection($properties)
    {
        if (!is_array($properties)) {
            $properties = [$properties];
        }
        foreach ($properties as $property) {
            $this->query['projection'][] = ['property' => $this->propertyName($property)];
        }
        return $this;
    }