package |
ArangoDBClient |
since |
3.5 |
inherited_from |
\ArangoDBClient\TransactionBase |
Methods
Constructs a streaming transaction object
__construct(\ArangoDBClient\Connection $connection, array $transactionArray = null
)
inherited_from |
\ArangoDBClient\TransactionBase::__construct() |
Parameters
$connection
\ArangoDBClient\Connection
$transactionArray
array
- array with collections used by the transaction
Initialise the transaction object
__construct(\ArangoDBClient\Connection $connection)
Inherited
Parameters
$connection
\ArangoDBClient\Connection
- the connection to be used
Exceptions
\ArangoDBClient\ClientException |
|
Get an attribute, magic method
__get(string $key) : mixed
Inherited
This function is mapped to get() internally.
Parameters
Returns
mixed
- value of attribute, NULL if attribute is not set
Is triggered by calling isset() or empty() on inaccessible properties.
__isset(string $key) : boolean
Inherited
Parameters
Returns
boolean
returns true or false (set or not set)
Set an attribute, magic method
__set(string $key, mixed $value) : void
Inherited
This is a magic method that allows the object to be used without
declaring all document attributes first.
Parameters
Exceptions
\ArangoDBClient\ClientException |
|
Get an attribute
get(string $key) : mixed
Inherited
Parameters
Returns
mixed
- value of attribute, NULL if attribute is not set
Get a participating collection of the transaction by name
Will throw an exception if the collection is not part of the transaction
getCollection(string $name) : \ArangoDBClient\StreamingTransactionCollection
Parameters
Exceptions
\ArangoDBClient\ClientException |
|
Returns
\ArangoDBClient\StreamingTransactionCollection
- collection object
Get collections array
getCollections() : array
Inherited
This holds the read and write collections of the transaction
Returns
array
$value
Convenience function to directly get exclusive-collections without having to access
them from the collections attribute.
getExclusiveCollections() : array
Inherited
Get the transaction's id
getId() : string
Returns
string
- transaction id
Get lockTimeout value
getLockTimeout() : integer
Inherited
Returns
integer
lockTimeout
Convenience function to directly get read-collections without having to access
them from the collections attribute.
getReadCollections() : array
Inherited
get waitForSync value
getWaitForSync() : boolean
Inherited
Returns
boolean
waitForSync
Convenience function to directly get write-collections without having to access
them from the collections attribute.
getWriteCollections() : array
Inherited
Executes an AQL query inside the transaction
query(array $data) : \ArangoDBClient\Cursor
This is a shortcut for creating a new Statement and executing it.
Parameters
$data
array
- query data, as is required by Statement::__construct()
Exceptions
\ArangoDBClient\ClientException |
|
Returns
\ArangoDBClient\Cursor
- query cursor, as returned by Statement::execute()
Sets an attribute
set($key, $value)
Inherited
Parameters
$key
$value
Exceptions
\ArangoDBClient\ClientException |
|
Set the collections array.
setCollections(array $value)
Inherited
The array should have 2 sub-arrays, namely 'read' and 'write' which should hold the respective collections
for the transaction
Parameters
$value
array
Convenience function to directly set exclusive-collections without having to access
them from the collections attribute.
setExclusiveCollections(array $value)
Inherited
Set the transaction's id - this is used internally and should not be called by end users
setId(mixed $id)
Parameters
$id
mixed
- transaction id as number or string
Set lockTimeout value
setLockTimeout(integer $value)
Inherited
Parameters
$value
integer
Exceptions
\ArangoDBClient\ClientException |
|
Convenience function to directly set read-collections without having to access
them from the collections attribute.
setReadCollections(array $value)
Inherited
set waitForSync value
setWaitForSync(boolean $value)
Inherited
Parameters
$value
boolean
Exceptions
\ArangoDBClient\ClientException |
|
Convenience function to directly set write-collections without having to access
them from the collections attribute.
setWriteCollections(array $value)
Inherited
Build the object's attributes from a given array
buildTransactionAttributesFromArray($options)
inherited_from |
\ArangoDBClient\TransactionBase::buildTransactionAttributesFromArray() |
Parameters
$options
Exceptions
\ArangoDBClient\ClientException |
|
Build the object's attributes from a given array
buildTransactionAttributesFromArray($options)
Inherited
Parameters
$options
Exceptions
\ArangoDBClient\ClientException |
|
Return the connection object
getConnection() : \ArangoDBClient\Connection
Inherited
Returns
\ArangoDBClient\Connection
- the connection object
Properties
The transaction's attributes.
$attributes : array
An array of collections used by this transaction
$_collections : array
The connection object
$_connection : \ArangoDBClient\Connection
The transaction id - assigned by the server
$_id : string
Constants
Collections index
ENTRY_COLLECTIONS = 'collections'
EXCLUSIVE index
ENTRY_EXCLUSIVE = 'exclusive'
class constant for id values
ENTRY_ID = 'id'
Lock timeout index
ENTRY_LOCK_TIMEOUT = 'lockTimeout'
Read index
ENTRY_READ = 'read'
WaitForSync index
ENTRY_WAIT_FOR_SYNC = 'waitForSync'
WRITE index
ENTRY_WRITE = 'write'