ArangoDB-PHP API Documentation
  • Namespace
  • Class
  • Deprecated

Namespaces

  • triagens
    • ArangoDb

Classes

  • AdminHandler
  • AqlUserFunction
  • Autoloader
  • Batch
  • BatchPart
  • BindVars
  • Collection
  • CollectionHandler
  • Connection
  • ConnectionOptions
  • Cursor
  • Database
  • DefaultValues
  • Document
  • DocumentHandler
  • Edge
  • EdgeDefinition
  • EdgeHandler
  • Endpoint
  • Export
  • ExportCursor
  • Graph
  • GraphHandler
  • Handler
  • HttpHelper
  • HttpResponse
  • QueryCacheHandler
  • QueryHandler
  • Statement
  • TraceRequest
  • TraceResponse
  • Transaction
  • Traversal
  • UpdatePolicy
  • UrlHelper
  • Urls
  • User
  • UserHandler
  • ValueValidator
  • Vertex
  • VertexHandler

Exceptions

  • ClientException
  • ConnectException
  • Exception
  • ServerException

Class Collection

Value object representing a collection


Namespace: triagens\ArangoDb
Package: triagens\ArangoDb
Since: 0.2
Located at Collection.php

Methods summary

public
# __construct( string $name = null )

Constructs an empty collection

Constructs an empty collection

Parameters

$name
  • name for the collection

Throws

triagens\ArangoDb\ClientException
public static triagens\ArangoDb\Collection
# createFromArray( array $values )

Factory method to construct a new collection

Factory method to construct a new collection

Parameters

$values
  • initial values for collection

Returns

triagens\ArangoDb\Collection

Throws

triagens\ArangoDb\ClientException
public static string
# getDefaultType( )

Get the default collection type

Get the default collection type

Returns

string
  • name
public
# __clone( )

Clone a collection

Clone a collection

Returns the clone

Magic

public string
# __toString( )

Get a string representation of the collection

Get a string representation of the collection

Returns the collection as JSON-encoded string

Returns

string
  • JSON-encoded collection

Magic

public string
# toJson( )

Returns the collection as JSON-encoded string

Returns the collection as JSON-encoded string

Returns

string
  • JSON-encoded collection
public string
# toSerialized( )

Returns the collection as a serialized string

Returns the collection as a serialized string

Returns

string
  • PHP serialized collection
public array
# getAll( )

Get all collection attributes

Get all collection attributes

Returns

array
  • array of all collection attributes
public
# set( string $key, mixed $value )

Set a collection attribute

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

$key
  • attribute name
$value
  • value for attribute

Throws

triagens\ArangoDb\ClientException
public boolean
# setId( mixed $id )

Set the collection id

Set the collection id

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

Parameters

$id
  • collection id

Returns

boolean

Throws

triagens\ArangoDb\ClientException
public mixed
# getId( )

Get the collection id (if already known)

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
public
# setName( string $name )

Set the collection name

Set the collection name

Parameters

$name
  • name

Throws

triagens\ArangoDb\ClientException
public string
# getName( )

Get the collection name (if already known)

Get the collection name (if already known)

Returns

string
  • name
public
# setType( integer $type )

Set the collection type.

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

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

Throws

triagens\ArangoDb\ClientException
public string
# getType( )

Get the collection type (if already known)

Get the collection type (if already known)

Returns

string
  • name
public
# setStatus( integer $status )

Set the collection status.

Set the collection status.

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

Parameters

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

Throws

triagens\ArangoDb\ClientException
public integer
# getStatus( )

Get the collection status (if already known)

Get the collection status (if already known)

Returns

integer
  • status
public
# setKeyOptions( array $keyOptions )

Set the collection key options.

Set the collection key options.

Parameters

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

Throws

triagens\ArangoDb\ClientException
public array
# getKeyOptions( )

Get the collection key options (if already known)

Get the collection key options (if already known)

Returns

array
  • keyOptions
public
# setWaitForSync( boolean $value )

Set the waitForSync value

Set the waitForSync value

Parameters

$value
  • waitForSync value
public boolean
# getWaitForSync( )

Get the waitForSync value (if already known)

Get the waitForSync value (if already known)

Returns

boolean
  • waitForSync value
public
# setJournalSize( integer $value )

Set the journalSize value

Set the journalSize value

Parameters

$value
  • journalSize value
public integer
# getJournalSize( )

Get the journalSize value (if already known)

Get the journalSize value (if already known)

Returns

integer
  • journalSize value
public
# setIsSystem( boolean $value )

Set the isSystem value

Set the isSystem value

Parameters

$value
  • isSystem: false->user collection, true->system collection
public boolean
# getIsSystem( )

Get the isSystem value (if already known)

Get the isSystem value (if already known)

Returns

boolean
  • isSystem value
public
# setIsVolatile( boolean $value )

Set the isVolatile value

Set the isVolatile value

Parameters

$value
  • isVolatile value
public boolean
# getIsVolatile( )

Get the isVolatile value (if already known)

Get the isVolatile value (if already known)

Returns

boolean
  • isVolatile value
public
# setNumberOfShards( integer $value )

Set the numberOfShards value

Set the numberOfShards value

Parameters

$value
  • numberOfShards value
public integer
# getNumberOfShards( )

Get the numberOfShards value (if already known)

Get the numberOfShards value (if already known)

Returns

integer
  • numberOfShards value
public
# setShardKeys( array $value )

Set the shardKeys value

Set the shardKeys value

Parameters

$value
  • shardKeys value
public array
# getShardKeys( )

Get the shardKeys value (if already known)

Get the shardKeys value (if already known)

Returns

array
  • shardKeys value

Constants summary

string ENTRY_ID

Collection id index

Collection id index

# 'id'
string ENTRY_NAME

Collection name index

Collection name index

# 'name'
string ENTRY_TYPE

Collection type index

Collection type index

# 'type'
string ENTRY_WAIT_SYNC

Collection 'waitForSync' index

Collection 'waitForSync' index

# 'waitForSync'
string ENTRY_JOURNAL_SIZE

Collection 'journalSize' index

Collection 'journalSize' index

# 'journalSize'
string ENTRY_STATUS

Collection 'status' index

Collection 'status' index

# 'status'
string ENTRY_KEY_OPTIONS

Collection 'keyOptions' index

Collection 'keyOptions' index

# 'keyOptions'
string ENTRY_IS_SYSTEM

Collection 'isSystem' index

Collection 'isSystem' index

# 'isSystem'
string ENTRY_IS_VOLATILE

Collection 'isVolatile' index

Collection 'isVolatile' index

# 'isVolatile'
string ENTRY_NUMBER_OF_SHARDS

Collection 'numberOfShards' index

Collection 'numberOfShards' index

# 'numberOfShards'
string ENTRY_SHARD_KEYS

Collection 'shardKeys' index

Collection 'shardKeys' index

# 'shardKeys'
string OPTION_PROPERTIES

properties option

properties option

# 'properties'
integer TYPE_DOCUMENT

document collection type

document collection type

# 2
integer TYPE_EDGE

edge collection type

edge collection type

# 3
integer STATUS_NEW_BORN

New born collection

New born collection

# 1
integer STATUS_UNLOADED

Unloaded collection

Unloaded collection

# 2
integer STATUS_LOADED

Loaded collection

Loaded collection

# 3
integer STATUS_BEING_UNLOADED

Collection being unloaded

Collection being unloaded

# 4
integer STATUS_DELETED

Deleted collection

Deleted collection

# 5
ArangoDB-PHP API Documentation API documentation generated by ApiGen