Datastore/src/Query/Query.php
public function order($property, $direction = self::ORDER_DEFAULT)
    {
        $this->query['order'][] = [
            'property' => $this->propertyName($property),
            'direction' => $direction
        ];

        return $this;
    }
public function order($property, $direction = self::ORDER_DEFAULT)
    {
        $this->query['order'][] = [
            'property' => $this->propertyName($property),
            'direction' => $direction
        ];

        return $this;
    }
public function order ( $ property , $ direction = self :: ORDER_DEFAULT ) { $ this -> query [ 'order' ] [ ] = [ 'property' => $ this -> propertyName ( $ property ) , 'direction' => $ direction ] ; return $ this ; }
Specify an order for the query.

Example:
```
$query->order('birthDate', Query::ORDER_DESCENDING);
```

@see https://cloud.google.com/datastore/reference/rest/v1/projects/runQuery#Direction Allowed Directions

@param string $property The property to order by.
@param string $direction [optional] The direction to order in. Google
Cloud PHP provides class constants which map to allowed Datastore
values. Those constants are `Query::ORDER_DESCENDING` and
`Query::ORDER_ASCENDING`. **Defaults to** `Query::ORDER_ACENDING`.
@return Query
Specify an order for the query .