Class QdbBatchResult
A result of a batch query.
A QdbBatchResult is returned by \QdbCluster::runBatch().
This class behaves like an array containing the operation results.
Operations results are stored in the order in which operations have been added to the qdb\QdbBatch, which is not necessarily the order in which operation are executed in the cluster.
An exception will be thrown when reading the result of an operation that failed.
The exception type will match the failure of that particular operation, like qdb\QdbAliasAlreadyExistsException, qdb\QdbAliasNotFoundException, qdb\QdbContainerEmptyException or qdb\QdbIncompatibleTypeException.
- qdb\QdbBatchResult implements qdb\ArrayAccess, qdb\Countable
Namespace: qdb
Example:
Example:
// first, prepare the batch $batch = new QdbBatch(); $batch->put('key 0', 'value 0'); $batch->put('key 1', 'value 1'); $batch->get('key 2'); // then, execute it $result = $cluster->runBatch($batch); // finally, read the results // (the following line may throw QdbAliasNotFoundException or QdbIncompatibleTypeException) $value2 = $result[2];