/** * @param \Google_Service_Datastore_PropertyReference|string $property * @return $this */ public function withProperty($property) { if (!$property instanceof \Google_Service_Datastore_PropertyReference) { $property = \DatastoreHelper::newPropertyReference($property); } $this->property = $property; return $this; }
/** * @param \Google_Service_Datastore_PropertyReference|\Google_Service_Datastore_PropertyReference[]|string|string[] $property_or_properties * @return $this * @throws ParameterException */ public function withGroupBy($property_or_properties) { if (!is_array($property_or_properties)) { $property_or_properties = [$property_or_properties]; } foreach ($property_or_properties as $property) { if (is_string($property)) { $property = \DatastoreHelper::newPropertyReference($property); } else { if (!$property instanceof \Google_Service_Datastore_PropertyReference) { throw new ParameterException(__METHOD__, ['string', \Google_Service_Datastore_PropertyReference::class]); } } $this->groupBys[] = $property; } return $this; }
/** * @param string $propertyName * @param Direction|string $direction * @return Google_Service_Datastore_PropertyReference */ public static function newPropertyOrder($propertyName, $direction = 'ASCENDING') { $order = new \Google_Service_Datastore_PropertyOrder(); $order->setProperty(\DatastoreHelper::newPropertyReference($propertyName)); $order->setDirection(Direction::get($direction)->value()); return $order; }