public function executeBatchShards(Context $ctx, array $bound_shard_queries, $tablet_type, $as_transaction) { $request = new Proto\Vtgate\ExecuteBatchShardsRequest(); ProtoUtils::addQueries($request, $bound_shard_queries); $request->setTabletType($tablet_type); $request->setAsTransaction($as_transaction); if ($ctx->getCallerId()) { $request->setCallerId($ctx->getCallerId()); } $response = $this->client->executeBatchShards($ctx, $request); ProtoUtils::checkError($response); $results = array(); foreach ($response->getResultsList() as $result) { $results[] = new Cursor($result); } return $results; }