public function executeBatchKeyspaceIds(Context $ctx, array $bound_keyspace_id_queries, $tablet_type, $as_transaction) { $request = new Proto\Vtgate\ExecuteBatchKeyspaceIdsRequest(); ProtoUtils::addQueries($request, $bound_keyspace_id_queries); $request->setTabletType($tablet_type); $request->setAsTransaction($as_transaction); if ($ctx->getCallerId()) { $request->setCallerId($ctx->getCallerId()); } $response = $this->client->executeBatchKeyspaceIds($ctx, $request); ProtoUtils::checkError($response); $results = array(); foreach ($response->getResultsList() as $result) { $results[] = new Cursor($result); } return $results; }
public function executeBatchKeyspaceIds(Context $ctx, array $bound_keyspace_id_queries, $tablet_type = Proto\Topodata\TabletType::MASTER) { if (!$this->inTransaction()) { throw new \Vitess\Exception('execute called while not in transaction.'); } $request = new Proto\Vtgate\ExecuteBatchKeyspaceIdsRequest(); $request->setSession($this->session); ProtoUtils::addQueries($request, $bound_keyspace_id_queries); $request->setTabletType($tablet_type); if ($ctx->getCallerId()) { $request->setCallerId($ctx->getCallerId()); } $response = $this->client->executeBatchKeyspaceIds($ctx, $request); $this->session = $response->getSession(); ProtoUtils::checkError($response); $results = array(); foreach ($response->getResultsList() as $result) { $results[] = new Cursor($result); } return $results; }