/** * Begin a transaction and return it's reference id * * @param bool $bol_cross_group * @return string * @throws \Exception */ public function beginTransaction($bol_cross_group = FALSE) { if ($bol_cross_group) { throw new \Exception("Cross group transactions not supported over JSON API"); } $obj_request = new \Google_Service_Datastore_BeginTransactionRequest(); /** @var \Google_Service_Datastore_BeginTransactionResponse $obj_response */ $obj_response = $this->obj_datasets->beginTransaction($this->str_dataset_id, $obj_request); return $obj_response->getTransaction(); }