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

order() public method

Example: $query->order('birthDate', Query::ORDER_DESCENDING);
See also: https://cloud.google.com/datastore/reference/rest/v1/projects/runQuery#Direction Allowed Directions
public order ( string $property, string $direction = self::ORDER_DEFAULT ) : Query
$property string The property to order by.
$direction string The direction to order in.
return Query
    public function order($property, $direction = self::ORDER_DEFAULT)
    {
        $this->query['order'][] = ['property' => $this->propertyName($property), 'direction' => $direction];
        return $this;
    }