示例#1
0
 public function executeEntityIds(VTContext $ctx, $query, $keyspace, $entity_column_name, array $entity_keyspace_ids, array $bind_vars, $tablet_type)
 {
     $request = new \vtgate\ExecuteEntityIdsRequest();
     $request->setQuery(VTProto::BoundQuery($query, $bind_vars));
     $request->setTabletType($tablet_type);
     $request->setKeyspace($keyspace);
     $request->setEntityColumnName($entity_column_name);
     VTProto::addEntityKeyspaceIds($request, $entity_keyspace_ids);
     if ($ctx->getCallerId()) {
         $request->setCallerId($ctx->getCallerId());
     }
     $response = $this->client->executeEntityIds($ctx, $request);
     VTProto::checkError($response);
     return new VTCursor($response->getResult());
 }
示例#2
0
 public function executeEntityIds(VTContext $ctx, $query, $keyspace, $entity_column_name, array $entity_keyspace_ids, array $bind_vars, $tablet_type = \topodata\TabletType::MASTER, $not_in_transaction = FALSE)
 {
     if (!$this->inTransaction()) {
         throw new VTException('execute called while not in transaction.');
     }
     $request = new \vtgate\ExecuteEntityIdsRequest();
     $request->setSession($this->session);
     $request->setQuery(VTProto::BoundQuery($query, $bind_vars));
     $request->setTabletType($tablet_type);
     $request->setNotInTransaction($not_in_transaction);
     $request->setKeyspace($keyspace);
     $request->setEntityColumnName($entity_column_name);
     VTProto::addEntityKeyspaceIds($request, $entity_keyspace_ids);
     if ($ctx->getCallerId()) {
         $request->setCallerId($ctx->getCallerId());
     }
     $response = $this->client->executeEntityIds($ctx, $request);
     $this->session = $response->getSession();
     VTProto::checkError($response);
     return new VTCursor($response->getResult());
 }