Constants

ENTRY_ID

ENTRY_ID

Collection id index

ENTRY_NAME

ENTRY_NAME

Collection name index

ENTRY_TYPE

ENTRY_TYPE

Collection type index

ENTRY_WAIT_SYNC

ENTRY_WAIT_SYNC

Collection 'waitForSync' index

ENTRY_JOURNAL_SIZE

ENTRY_JOURNAL_SIZE

Collection 'journalSize' index

ENTRY_STATUS

ENTRY_STATUS

Collection 'status' index

ENTRY_KEY_OPTIONS

ENTRY_KEY_OPTIONS

Collection 'keyOptions' index

ENTRY_IS_SYSTEM

ENTRY_IS_SYSTEM

Collection 'isSystem' index

ENTRY_IS_VOLATILE

ENTRY_IS_VOLATILE

Collection 'isVolatile' index

ENTRY_NUMBER_OF_SHARDS

ENTRY_NUMBER_OF_SHARDS

Collection 'numberOfShards' index

ENTRY_SHARD_KEYS

ENTRY_SHARD_KEYS

Collection 'shardKeys' index

OPTION_PROPERTIES

OPTION_PROPERTIES

properties option

TYPE_DOCUMENT

TYPE_DOCUMENT

document collection type

TYPE_EDGE

TYPE_EDGE

edge collection type

STATUS_NEW_BORN

STATUS_NEW_BORN

New born collection

STATUS_UNLOADED

STATUS_UNLOADED

Unloaded collection

STATUS_LOADED

STATUS_LOADED

Loaded collection

STATUS_BEING_UNLOADED

STATUS_BEING_UNLOADED

Collection being unloaded

STATUS_DELETED

STATUS_DELETED

Deleted collection

Properties

$_id

$_id : mixed

The collection id (might be NULL for new collections)

Type

mixed — - collection id

$_name

$_name : string

The collection name (might be NULL for new collections)

Type

string — - collection name

$_type

$_type : integer

The collection type (might be NULL for new collections)

Type

integer — - collection type

$_waitForSync

$_waitForSync : boolean

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

Type

boolean — - waitForSync value

$_journalSize

$_journalSize : integer

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

Type

integer — - journalSize value

$_isSystem

$_isSystem : boolean

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

Type

boolean — - isSystem value

$_isVolatile

$_isVolatile : boolean

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

Type

boolean — - isVolatile value

$_numberOfShards

$_numberOfShards : integer

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

Type

integer — - numberOfShards value

$_shardKeys

$_shardKeys : array

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

Type

array — - shardKeys value

$_status

$_status : integer

The collection status value

Type

integer — - status value

$_keyOptions

$_keyOptions : array

The collection keyOptions value

Type

array — - keyOptions value

Methods

createFromArray()

createFromArray(array $values) : \triagens\ArangoDb\Collection

Factory method to construct a new collection

Parameters

array $values
  • initial values for collection

Throws

\triagens\ArangoDb\ClientException

Returns

\triagens\ArangoDb\Collection

getDefaultType()

getDefaultType() : string

Get the default collection type

Returns

string —
  • name

__clone()

__clone() : void

Clone a collection

Returns the clone

__toString()

__toString() : string

Get a string representation of the collection

Returns the collection as JSON-encoded string

Returns

string —
  • JSON-encoded collection

toJson()

toJson() : string

Returns the collection as JSON-encoded string

Returns

string —
  • JSON-encoded collection

toSerialized()

toSerialized() : string

Returns the collection as a serialized string

Returns

string —
  • PHP serialized collection

getAll()

getAll() : array

Get all collection attributes

Returns

array —
  • array of all collection attributes

set()

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

Set a collection attribute

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

string $key
  • attribute name
mixed $value
  • value for attribute

Throws

\triagens\ArangoDb\ClientException

setId()

setId(mixed $id) : boolean

Set the collection id

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

Parameters

mixed $id
  • collection id

Throws

\triagens\ArangoDb\ClientException

Returns

boolean

getId()

getId() : mixed

Get the collection id (if already known)

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

setName()

setName(string $name) : void

Set the collection name

Parameters

string $name
  • name

Throws

\triagens\ArangoDb\ClientException

getName()

getName() : string

Get the collection name (if already known)

Returns

string —
  • name

setType()

setType(integer $type) : void

Set the collection type.

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

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

Throws

\triagens\ArangoDb\ClientException

getType()

getType() : string

Get the collection type (if already known)

Returns

string —
  • name

setStatus()

setStatus(integer $status) : void

Set the collection status.

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

Parameters

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

Throws

\triagens\ArangoDb\ClientException

getStatus()

getStatus() : integer

Get the collection status (if already known)

Returns

integer —
  • status

setKeyOptions()

setKeyOptions(array $keyOptions) : void

Set the collection key options.

Parameters

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

Throws

\triagens\ArangoDb\ClientException

getKeyOptions()

getKeyOptions() : array

Get the collection key options (if already known)

Returns

array —
  • keyOptions

setWaitForSync()

setWaitForSync(boolean $value) : void

Set the waitForSync value

Parameters

boolean $value
  • waitForSync value

getWaitForSync()

getWaitForSync() : boolean

Get the waitForSync value (if already known)

Returns

boolean —
  • waitForSync value

setJournalSize()

setJournalSize(boolean $value) : void

Set the journalSize value

Parameters

boolean $value
  • journalSize value

getJournalSize()

getJournalSize() : boolean

Get the journalSize value (if already known)

Returns

boolean —
  • journalSize value

setIsSystem()

setIsSystem(boolean $value) : void

Set the isSystem value

Parameters

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

getIsSystem()

getIsSystem() : boolean

Get the isSystem value (if already known)

Returns

boolean —
  • isSystem value

setIsVolatile()

setIsVolatile(boolean $value) : void

Set the isVolatile value

Parameters

boolean $value
  • isVolatile value

getIsVolatile()

getIsVolatile() : boolean

Get the isVolatile value (if already known)

Returns

boolean —
  • isVolatile value

setNumberOfShards()

setNumberOfShards(integer $value) : void

Set the numberOfShards value

Parameters

integer $value
  • numberOfShards value

getNumberOfShards()

getNumberOfShards() : integer

Get the numberOfShards value (if already known)

Returns

integer —
  • numberOfShards value

setShardKeys()

setShardKeys(array $value) : void

Set the shardKeys value

Parameters

array $value
  • shardKeys value

getShardKeys()

getShardKeys() : array

Get the shardKeys value (if already known)

Returns

array —
  • shardKeys value