Streaming transaction collection object


package ArangoDBClient
since 3.5
inherited_from \ArangoDBClient\Collection

 Methods

Clone a collection

__clone() : void
Inherited

Returns the clone

magic

Constructs a streaming transaction collection object

__construct(\ArangoDBClient\StreamingTransaction $trx, string $name, string $mode) 
inherited_from \ArangoDBClient\Collection::__construct()

Parameters

$trx

\ArangoDBClient\StreamingTransaction
  • the transaction

$name

string
  • collection name

$mode

string
  • lock mode, i.e. 'read', 'write', 'exclusive'

Constructs an empty collection

__construct(string $name = null
Inherited

Parameters

$name

string
  • name for the collection

Exceptions

\ArangoDBClient\ClientException

Return the name of the collection

__toString() : string

Returns the collection as JSON-encoded string

magic
inherited_from \ArangoDBClient\Collection::__toString()

Returns

string- collection name

Get a string representation of the collection

__toString() : string
Inherited

Returns the collection as JSON-encoded string

magic

Returns

string- JSON-encoded collection

Factory method to construct a new collection

createFromArray(array $values) : \ArangoDBClient\Collection
InheritedStatic

Parameters

$values

array
  • initial values for collection

Exceptions

\ArangoDBClient\ClientException

Returns

\ArangoDBClient\Collection

Get all collection attributes

getAll() : array
Inherited

Returns

array- array of all collection attributes

Get the default collection type

getDefaultType() : string
InheritedStatic

Returns

string- name

Get the distributeShardsLike (if already known)

getDistributeShardsLike() : mixed
Inherited

Returns

mixed- distributeShardsLike value

Get the collection id (if already known)

getId() : mixed
Inherited

Collection ids are generated on the server only.

Collection ids are numeric but might be bigger than PHP_INT_MAX. To reliably store a collection id elsewhere, a PHP string should be used

Returns

mixed- collection id, might be NULL if collection does not yet have an id

Get the isSystem value (if already known)

getIsSystem() : boolean
Inherited

Returns

boolean- isSystem value

Get the isVolatile value (if already known)

getIsVolatile() : boolean
Inherited

Returns

boolean- isVolatile value

Get the journalSize value (if already known)

getJournalSize() : integer
Inherited

Returns

integer- journalSize value

Get the collection key options (if already known)

getKeyOptions() : array
Inherited

Returns

array- keyOptions

Get the minReplicationFactor value (if already known)

getMinReplicationFactor() : mixed
Inherited

Returns

mixed- minReplicationFactor value

Return the lock mode of the collection

getMode() : string

Returns

string- lock mode, i.e. 'read', 'write', 'exclusive'

Return the name of the collection

getName() : string
inherited_from \ArangoDBClient\Collection::getName()

Returns

string- collection name

Get the collection name (if already known)

getName() : string
Inherited

Returns

string- name

Get the numberOfShards value (if already known)

getNumberOfShards() : mixed
Inherited

Returns

mixed- numberOfShards value

Get the replicationFactor value (if already known)

getReplicationFactor() : mixed
Inherited

Returns

mixed- replicationFactor value

Get the shardKeys value (if already known)

getShardKeys() : array
Inherited

Returns

array- shardKeys value

Get the sharding strategy value (if already known)

getShardingStrategy() : mixed
Inherited

Returns

mixed- shardingStrategy value

Get the smart join attribute value (if already known)

getSmartJoinAttribute() : mixed
Inherited

Returns

mixed- smart join attribute value

Get the collection status (if already known)

getStatus() : integer
Inherited

Returns

integer- status

Return the transaction's id

getTrxId() : string

Returns

string- transaction id

Get the collection type (if already known)

getType() : string
Inherited

Returns

string- name

Get the waitForSync value (if already known)

getWaitForSync() : boolean
Inherited

Returns

boolean- waitForSync value

Set a collection attribute

set(string $key, mixed $value) : void
Inherited

The key (attribute name) must be a string.

This will validate the value of the attribute and might throw an exception if the value is invalid.

Parameters

$key

string
  • attribute name

$value

mixed
  • value for attribute

Exceptions

\ArangoDBClient\ClientException

Set the distribute shards like value

setDistributeShardsLike(string $value) : void
Inherited

Parameters

$value

string
  • distributeShardsLike value

Set the collection id

setId(mixed $id) : boolean
Inherited

This will throw if the id of an existing collection gets updated to some other id

Parameters

$id

mixed
  • collection id

Exceptions

\ArangoDBClient\ClientException

Returns

boolean

Set the isSystem value

setIsSystem(boolean $value) : void
Inherited

Parameters

$value

boolean
  • isSystem: false->user collection, true->system collection

Set the isVolatile value

setIsVolatile(boolean $value) : void
Inherited

Parameters

$value

boolean
  • isVolatile value

Set the journalSize value

setJournalSize(integer $value) : void
Inherited

Parameters

$value

integer
  • journalSize value

Set the collection key options.

setKeyOptions(array $keyOptions) : void
Inherited

Parameters

$keyOptions

array
  • An associative array containing optional keys: type, allowUserKeys, increment, offset.

Exceptions

\ArangoDBClient\ClientException

Set the minReplicationFactor value

setMinReplicationFactor(integer $value) : void
Inherited

Parameters

$value

integer
  • minReplicationFactor value

Set the collection name

setName(string $name) : void
Inherited

Parameters

$name

string
  • name

Exceptions

\ArangoDBClient\ClientException

Set the numberOfShards value

setNumberOfShards(integer $value) : void
Inherited

Parameters

$value

integer
  • numberOfShards value

Set the replicationFactor value

setReplicationFactor(mixed $value) : void
Inherited

Parameters

$value

mixed
  • replicationFactor value (either a number, or "satellite")

Set the shardKeys value

setShardKeys(array $value) : void
Inherited

Parameters

$value

array
  • shardKeys value

Set the shardingStrategy value

setShardingStrategy(string $value) : void
Inherited

Parameters

$value

string
  • shardingStrategy value

Set the smart join attribute value

setSmartJoinAttribute(string $value) : void
Inherited

Parameters

$value

string
  • smartJoinAttribute value

Set the collection status.

setStatus(integer $status) : void
Inherited

This is useful before a collection is create()'ed in order to set a status.

Parameters

$status

integer
  • statuses = 1 -> new born, status = 2 -> unloaded, status = 3 -> loaded, status = 4 -> being unloaded, status = 5 -> deleted

Exceptions

\ArangoDBClient\ClientException

Set the collection type.

setType(integer $type) : void
Inherited

This is useful before a collection is create() 'ed in order to set a different type than the normal one. For example this must be set to 3 in order to create an edge-collection.

Parameters

$type

integer
  • type = 2 -> normal collection, type = 3 -> edge-collection

Exceptions

\ArangoDBClient\ClientException

Set the waitForSync value

setWaitForSync(boolean $value) : void
Inherited

Parameters

$value

boolean
  • waitForSync value

Returns the collection as JSON-encoded string

toJson() : string
Inherited

Returns

string- JSON-encoded collection

Returns the collection as a serialized string

toSerialized() : string
Inherited

Returns

string- PHP serialized collection

 Properties

 

The distributeShardsLike value (might be NULL for new collections)

$_distributeShardsLike : mixed

Default

 

The collection id (might be NULL for new collections)

$_id : mixed

Default

 

The collection isSystem value (might be NULL for new collections)

$_isSystem : boolean

Default

 

The collection isVolatile value (might be NULL for new collections)

$_isVolatile : boolean

Default

 

The collection journalSize value (might be NULL for new collections)

$_journalSize : integer

Default

 

The collection keyOptions value

$_keyOptions : array

Default

 

The minimum replicationFactor value for writes to be successful

$_minReplicationFactor : mixed

Default

 

Lock mode for this collection, i.e. 'read', 'write' or 'exclusive'

$_mode : string

Default

 

Collection name - assigned on construction

$_name : string

Default

inherited_from \ArangoDBClient\Collection::_name
 

The collection name (might be NULL for new collections)

$_name : string

Default

 

The collection numberOfShards value (might be NULL for new collections)

$_numberOfShards : mixed

Default

 

The replicationFactor value (might be NULL for new collections)

$_replicationFactor : mixed

Default

 

The collection shardKeys value (might be NULL for new collections)

$_shardKeys : array

Default

 

The shardingStrategy value (might be NULL for new collections)

$_shardingStrategy : mixed

Default

 

The smartJoinAttribute value (might be NULL for new collections)

$_smartJoinAttribute : mixed

Default

 

The collection status value

$_status : integer

Default

 

The transaction - assigned on construction

$_trx : \ArangoDBClient\StreamingTransaction

Default

 

The collection type (might be NULL for new collections)

$_type : integer

Default

 

The collection waitForSync value (might be NULL for new collections)

$_waitForSync : boolean

Default

 Constants

 

Collection 'distributeShardsLike' index

ENTRY_DISTRIBUTE_SHARDS_LIKE = 'distributeShardsLike' 
 

Collection id index

ENTRY_ID = 'id' 
 

Collection 'isSystem' index

ENTRY_IS_SYSTEM = 'isSystem' 
 

Collection 'isVolatile' index

ENTRY_IS_VOLATILE = 'isVolatile' 
 

Collection 'journalSize' index

ENTRY_JOURNAL_SIZE = 'journalSize' 
 

Collection 'keyOptions' index

ENTRY_KEY_OPTIONS = 'keyOptions' 
 

Collection 'minReplicationFactor' index

ENTRY_MIN_REPLICATION_FACTOR = 'minReplicationFactor' 
 

Collection name index

ENTRY_NAME = 'name' 
 

Collection 'numberOfShards' index

ENTRY_NUMBER_OF_SHARDS = 'numberOfShards' 
 

Collection 'replicationFactor' index

ENTRY_REPLICATION_FACTOR = 'replicationFactor' 
 

Collection 'shardingStrategy' index

ENTRY_SHARDING_STRATEGY = 'shardingStrategy' 
 

Collection 'shardKeys' index

ENTRY_SHARD_KEYS = 'shardKeys' 
 

Collection 'smartJoinAttribute' index

ENTRY_SMART_JOIN_ATTRIBUTE = 'smartJoinAttribute' 
 

Collection 'status' index

ENTRY_STATUS = 'status' 
 

Collection type index

ENTRY_TYPE = 'type' 
 

Collection 'waitForSync' index

ENTRY_WAIT_SYNC = 'waitForSync' 
 

properties option

OPTION_PROPERTIES = 'properties' 
 

Collection being unloaded

STATUS_BEING_UNLOADED = 4 
 

Deleted collection

STATUS_DELETED = 5 
 

Loaded collection

STATUS_LOADED = 3 
 

New born collection

STATUS_NEW_BORN = 1 
 

Unloaded collection

STATUS_UNLOADED = 2 
 

document collection type

TYPE_DOCUMENT = 2 
 

edge collection type

TYPE_EDGE = 3