ENTRY_COLLECTIONS
ENTRY_COLLECTIONS
Collections index
Transaction object
A transaction is an object that is used to prepare and send a transaction to the server.
The object encapsulates:
The transaction object requires the connection object and can be initialized
with or without initial transaction configuration.
Any configuration can be set and retrieved by the object's methods like this:
$this->setAction('function (){your code};'); $this->setCollections(array('read' => 'my_read_collection, 'write' => array('col_1', 'col2')));
or like this:
$this->action('function (){your code};'); $this->collections(array('read' => 'my_read_collection, 'write' => array('col_1', 'col2')));
There are also helper functions to set collections directly, based on their locking:
$this->setWriteCollections($array or $string if single collection) $this->setReadCollections($array or $string if single collection)
$_connection : \triagens\ArangoDb\Connection
The connection object
__construct(\triagens\ArangoDb\Connection $connection, array $transactionArray) : \triagens\ArangoDb\Transaction
Initialise the transaction object
The $transaction array can be used to specify the collections, action and further options for the transaction in form of an array.
Example: array( 'collections' => array(
'write' => array(
'my_collection'
)
), 'action' => 'function (){}', 'waitForSync' => true )
\triagens\ArangoDb\Connection | $connection |
|
array | $transactionArray |
|
execute() : mixed
Execute the transaction
This will post the query to the server and return the results as a Cursor. The cursor can then be used to iterate the results.
throw exception if transaction failed
true if successful without a return value or the return value if one was set in the action
getConnection() : \triagens\ArangoDb\Connection
Return the connection object