package |
ArangoDBClient |
since |
3.5 |
inherited_from |
\ArangoDBClient\Collection |
Methods
Clone a collection
__clone() : void
Inherited
Constructs a streaming transaction collection object
__construct(\ArangoDBClient\StreamingTransaction $trx, string $name, string $mode)
inherited_from |
\ArangoDBClient\Collection::__construct() |
Parameters
$trx
\ArangoDBClient\StreamingTransaction
$mode
string
- lock mode, i.e. 'read', 'write', 'exclusive'
Constructs an empty collection
__construct(string $name = null
)
Inherited
Parameters
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
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
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
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
Return the transaction's id
getTrxId() : string
Returns
string
- transaction id
Get the collection type (if already known)
getType() : string
Inherited
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
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
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
Set the journalSize value
setJournalSize(integer $value) : void
Inherited
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
Exceptions
\ArangoDBClient\ClientException |
|
Set the numberOfShards value
setNumberOfShards(integer $value) : void
Inherited
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
Set the shardingStrategy value
setShardingStrategy(string $value) : void
Inherited
Set the smart join attribute value
setSmartJoinAttribute(string $value) : void
Inherited
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
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
The collection id (might be NULL for new collections)
$_id : mixed
The collection isSystem value (might be NULL for new collections)
$_isSystem : boolean
The collection isVolatile value (might be NULL for new collections)
$_isVolatile : boolean
The collection journalSize value (might be NULL for new collections)
$_journalSize : integer
The collection keyOptions value
$_keyOptions : array
The minimum replicationFactor value for writes to be successful
$_minReplicationFactor : mixed
Lock mode for this collection, i.e. 'read', 'write' or 'exclusive'
$_mode : string
Collection name - assigned on construction
$_name : string
inherited_from |
\ArangoDBClient\Collection::_name |
The collection name (might be NULL for new collections)
$_name : string
The collection numberOfShards value (might be NULL for new collections)
$_numberOfShards : mixed
The replicationFactor value (might be NULL for new collections)
$_replicationFactor : mixed
The collection shardKeys value (might be NULL for new collections)
$_shardKeys : array
The shardingStrategy value (might be NULL for new collections)
$_shardingStrategy : mixed
The smartJoinAttribute value (might be NULL for new collections)
$_smartJoinAttribute : mixed
The collection status value
$_status : integer
The transaction - assigned on construction
$_trx : \ArangoDBClient\StreamingTransaction
The collection type (might be NULL for new collections)
$_type : integer
The collection waitForSync value (might be NULL for new collections)
$_waitForSync : boolean
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