Methods
Clone a collection
__clone() : void
Constructs an empty collection
__construct(string $name = null
)
Parameters
Exceptions
\ArangoDBClient\ClientException |
|
Get a string representation of the collection
__toString() : string
Returns the collection as JSON-encoded string
Returns
string
- JSON-encoded collection
Factory method to construct a new collection
createFromArray(array $values) : \ArangoDBClient\Collection
Static
Parameters
$values
array
- initial values for collection
Exceptions
\ArangoDBClient\ClientException |
|
Returns
\ArangoDBClient\Collection
Get all collection attributes
getAll() : array
Returns
array
- array of all collection attributes
Get the default collection type
getDefaultType() : string
Static
Get the distributeShardsLike (if already known)
getDistributeShardsLike() : mixed
Returns
mixed
- distributeShardsLike value
Get the collection id (if already known)
getId() : mixed
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
Returns
boolean
- isSystem value
Get the isVolatile value (if already known)
getIsVolatile() : boolean
Returns
boolean
- isVolatile value
Get the journalSize value (if already known)
getJournalSize() : integer
Returns
integer
- journalSize value
Get the collection key options (if already known)
getKeyOptions() : array
Returns
array
- keyOptions
Get the minReplicationFactor value (if already known)
getMinReplicationFactor() : mixed
Returns
mixed
- minReplicationFactor value
Get the collection name (if already known)
getName() : string
Get the numberOfShards value (if already known)
getNumberOfShards() : mixed
Returns
mixed
- numberOfShards value
Get the replicationFactor value (if already known)
getReplicationFactor() : mixed
Returns
mixed
- replicationFactor value
Get the shardKeys value (if already known)
getShardKeys() : array
Returns
array
- shardKeys value
Get the sharding strategy value (if already known)
getShardingStrategy() : mixed
Returns
mixed
- shardingStrategy value
Get the smart join attribute value (if already known)
getSmartJoinAttribute() : mixed
Returns
mixed
- smart join attribute value
Get the collection status (if already known)
getStatus() : integer
Get the collection type (if already known)
getType() : string
Get the waitForSync value (if already known)
getWaitForSync() : boolean
Returns
boolean
- waitForSync value
Set a collection attribute
set(string $key, mixed $value) : void
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
Parameters
$value
string
- distributeShardsLike value
Set the collection id
setId(mixed $id) : boolean
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
Parameters
$value
boolean
- isSystem: false->user collection, true->system collection
Set the isVolatile value
setIsVolatile(boolean $value) : void
Set the journalSize value
setJournalSize(integer $value) : void
Set the collection key options.
setKeyOptions(array $keyOptions) : void
Parameters
$keyOptions
array
- An associative array containing optional keys: type, allowUserKeys, increment, offset.
Exceptions
\ArangoDBClient\ClientException |
|
Set the minReplicationFactor value
setMinReplicationFactor(integer $value) : void
Parameters
$value
integer
- minReplicationFactor value
Set the collection name
setName(string $name) : void
Parameters
Exceptions
\ArangoDBClient\ClientException |
|
Set the numberOfShards value
setNumberOfShards(integer $value) : void
Set the replicationFactor value
setReplicationFactor(mixed $value) : void
Parameters
$value
mixed
- replicationFactor value (either a number, or "satellite")
Set the shardKeys value
setShardKeys(array $value) : void
Set the shardingStrategy value
setShardingStrategy(string $value) : void
Set the smart join attribute value
setSmartJoinAttribute(string $value) : void
Set the collection status.
setStatus(integer $status) : void
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
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
Returns the collection as JSON-encoded string
toJson() : string
Returns
string
- JSON-encoded collection
Returns the collection as a serialized string
toSerialized() : string
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
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 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