Transaction base class, used by Transaction and StreamingTransaction

package ArangoDBClient
since 1.3

 Methods

Initialise the transaction object

__construct(\ArangoDBClient\Connection $connection) 

Parameters

$connection

\ArangoDBClient\Connection
  • the connection to be used

Exceptions

\ArangoDBClient\ClientException

Get an attribute, magic method

__get(string $key) : mixed

This function is mapped to get() internally.

magic

Parameters

$key

string
  • name of attribute

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

Parameters

$key

string
  • name of attribute

Returns

booleanreturns true or false (set or not set)

Set an attribute, magic method

__set(string $key, mixed $value) : void

This is a magic method that allows the object to be used without declaring all document attributes first.

magic

Parameters

$key

string
  • attribute name

$value

mixed
  • value for attribute

Exceptions

\ArangoDBClient\ClientException

Get an attribute

get(string $key) : mixed

Parameters

$key

string
  • name of attribute

Returns

mixed- value of attribute, NULL if attribute is not set

Get collections array

getCollections() : array

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

Returns

arrayparams

Get lockTimeout value

getLockTimeout() : integer

Returns

integerlockTimeout

Convenience function to directly get read-collections without having to access them from the collections attribute.

getReadCollections() : array

Returns

arrayparams

get waitForSync value

getWaitForSync() : boolean

Returns

booleanwaitForSync

Convenience function to directly get write-collections without having to access them from the collections attribute.

getWriteCollections() : array

Returns

arrayparams

Sets an attribute

set($key, $value) 

Parameters

$key

$value

Exceptions

\ArangoDBClient\ClientException

Set the collections array.

setCollections(array $value) 

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) 

Parameters

$value

array

Set lockTimeout value

setLockTimeout(integer $value) 

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) 

Parameters

$value

array

set waitForSync value

setWaitForSync(boolean $value) 

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) 

Parameters

$value

array

Build the object's attributes from a given array

buildTransactionAttributesFromArray($options) 

Parameters

$options

Exceptions

\ArangoDBClient\ClientException

Return the connection object

getConnection() : \ArangoDBClient\Connection

Returns

\ArangoDBClient\Connection- the connection object

 Properties

 

The transaction's attributes.

$attributes : array

Default

array()
 

The connection object

$_connection : \ArangoDBClient\Connection

Default

 Constants

 

Collections index

ENTRY_COLLECTIONS = 'collections' 
 

EXCLUSIVE index

ENTRY_EXCLUSIVE = 'exclusive' 
 

Lock timeout index

ENTRY_LOCK_TIMEOUT = 'lockTimeout' 
 

Read index

ENTRY_READ = 'read' 
 

WaitForSync index

ENTRY_WAIT_FOR_SYNC = 'waitForSync' 
 

WRITE index

ENTRY_WRITE = 'write'