public function createKey() { $key = new \Google_Service_Datastore_Key(); if (isset($this->config['namespace'])) { $partition = new \Google_Service_Datastore_PartitionId(); $partition->setNamespace($this->config['namespace']); $key->setPartitionId($partition); } return $key; }
/** * @return \Google_Service_Datastore_Key * @throws MissingFieldsException */ public function build() { $partitionId = new \Google_Service_Datastore_PartitionId(); $partitionId->setDatasetId($this->datasetId); $partitionId->setNamespace($this->namespace); $key = new \Google_Service_Datastore_Key(); $key->setPartitionId($partitionId); $key->setPath($this->getPath()); return $key; }