A handler that manages graphs.
| package | ArangoDBClient |
|---|---|
| since | 1.2 |
| inherited_from | \ArangoDBClient\Handler |
__construct(\ArangoDBClient\Connection $connection)
\ArangoDBClient\ConnectionaddEdgeDefinition(mixed $graph, \ArangoDBClient\EdgeDefinition $edgeDefinition) : \ArangoDBClient\Graph
This will add a further edge definition to the graph.
| since | 2.2 |
|---|
mixed\ArangoDBClient\EdgeDefinition\ArangoDBClient\Exception |
|---|
\ArangoDBClient\GraphaddOrphanCollection(mixed $graph, string $orphanCollection) : \ArangoDBClient\Graph
This will add a further orphan collection to the graph.
| since | 2.2 |
|---|
mixedstring\ArangoDBClient\Exception |
|---|
\ArangoDBClient\GraphclearCache() : \ArangoDBClient\GraphHandler
| fluent | This method is part of a fluent interface and will return the same instance |
|---|
\ArangoDBClient\GraphHandlercreateGraph(\ArangoDBClient\Graph $graph) : array
This will create a graph using the given graph object and return an array of the created graph object's attributes.
| since | 1.2 |
|---|
\ArangoDBClient\Graph\ArangoDBClient\Exception |
|---|
arraydeleteEdgeDefinition(mixed $graph, string $edgeDefinition, boolean $dropCollection = false) : \ArangoDBClient\Graph
This will delete an edge definition from the graph.
| since | 2.2 |
|---|
mixedstringboolean\ArangoDBClient\Exception |
|---|
\ArangoDBClient\GraphdeleteOrphanCollection(mixed $graph, string $orphanCollection, boolean $dropCollection = false) : \ArangoDBClient\Graph
This will delete an orphan collection from the graph.
| since | 2.2 |
|---|
mixedstringboolean\ArangoDBClient\Exception |
|---|
\ArangoDBClient\GraphdropGraph(mixed $graph, boolean $dropCollections = true) : boolean
| since | 1.2 |
|---|
mixedboolean\ArangoDBClient\Exception |
|---|
boolean- always true, will throw if there is an errorgetCacheEnabled() : boolean
booleangetEdge(mixed $graph, mixed $edgeId, array $options= array(), string $collection= null) : \ArangoDBClient\Document
This will throw if the edge cannot be fetched from the server
| since | 1.2 |
|---|
mixedmixedarrayoptional, array of options
string\ArangoDBClient\Exception |
|---|
\ArangoDBClient\Document- the edge document fetched from the servergetEdgeCollections(mixed $graph) : array
This will get all edge collections from the graph.
If this method or any method that calls this method is used in batch mode and caching is off,
then for each call, this method will make an out of batch API call to the db in order to get the appropriate collections.
If caching is on, then the GraphHandler will only call the DB API once for the chosen graph, and return data from cache for the following calls.
| since | 2.2 |
|---|
mixed\ArangoDBClient\Exception |
|---|
arraygetGraph(String $graph, array $options = array()) : \ArangoDBClient\Graph | false
This will get a graph.
| since | 1.2 |
|---|
Stringarray\ArangoDBClient\ClientException |
|---|
\ArangoDBClient\Graphfalse
getVertex(mixed $graph, mixed $vertexId, array $options= array(), string $collection= null) : \ArangoDBClient\Document
This will throw if the vertex cannot be fetched from the server
| since | 1.2 |
|---|
mixedmixedarrayoptional, an array of options:
string\ArangoDBClient\Exception |
|---|
\ArangoDBClient\DocumentgetVertexCollections(mixed $graph, array $options = array()) : array
This will get all vertex collection (orphans and used in edge definitions) from the graph.
If this method or any method that calls this method is used in batch mode and caching is off,
then for each call, this method will make an out of batch API call to the db in order to get the appropriate collections.
If caching is on, then the GraphHandler will only call the DB API once for the chosen graph, and return data from cache for the following calls.
mixedarrayOptions are :
\ArangoDBClient\ClientException@since |
2.2 |
|---|
arrayhasEdge(mixed $graph, mixed $edgeId) : boolean
This will call self::getEdge() internally and checks if there was an exception thrown which represents an 404 request.
mixedmixed\ArangoDBClient\Exception |
When any other error than a 404 occurs |
|---|
booleanhasVertex(mixed $graph, mixed $vertexId) : boolean
This will call self::getVertex() internally and checks if there was an exception thrown which represents an 404 request.
mixedmixed\ArangoDBClient\Exception |
When any other error than a 404 occurs |
|---|
booleanproperties(mixed $graph) : boolean
| since | 1.2 |
|---|
mixed\ArangoDBClient\Exception |
|---|
boolean- Returns an array of attributes. Will throw if there is an errorremoveEdge(mixed $graph, mixed $edgeId, mixed $revision= null, mixed $options= array(), string $collection= null) : boolean
| since | 1.2 |
|---|
mixedmixedmixedmixedoptional, array of options (see below) or the boolean value for $policy (for compatibility prior to version 1.1 of this method)
string\ArangoDBClient\Exception |
|---|
boolean- always true, will throw if there is an errorremoveVertex(mixed $graph, mixed $vertexId, mixed $revision= null, mixed $options= array(), string $collection= null) : boolean
| since | 1.2 |
|---|
mixedmixedmixedmixedoptional, an array of options (see below) or the boolean value for $policy (for compatibility prior to version 1.1 of this method)
string\ArangoDBClient\Exception |
|---|
boolean- always true, will throw if there is an errorreplaceEdge(mixed $graph, mixed $edgeId, mixed $label, \ArangoDBClient\Edge $document, mixed $options= array(), string $collection= null) : boolean
This will replace the edge on the server
This will throw if the edge cannot be Replaced
If policy is set to error (locally or globally through the ConnectionOptions)
and the passed document has a _rev value set, the database will check
that the revision of the to-be-replaced edge is the same as the one given.
| since | 1.2 |
|---|
mixedmixedmixed\ArangoDBClient\Edgemixedoptional, array of options (see below) or the boolean value for $policy (for compatibility prior to version 1.1 of this method)
string\ArangoDBClient\Exception |
|---|
boolean- always true, will throw if there is an errorreplaceEdgeDefinition(mixed $graph, \ArangoDBClient\EdgeDefinition $edgeDefinition) : \ArangoDBClient\Graph
This will replace an edge definition in the graph.
| since | 2.2 |
|---|
mixed\ArangoDBClient\EdgeDefinition\ArangoDBClient\Exception |
|---|
\ArangoDBClient\GraphreplaceVertex(mixed $graph, mixed $vertexId, \ArangoDBClient\Document $document, mixed $options= array(), string $collection= null) : boolean
This will update the vertex on the server
If policy is set to error (locally or globally through the ConnectionOptions)
and the passed document has a _rev value set, the database will check
that the revision of the to-be-replaced vertex is the same as the one given.
| since | 1.2 |
|---|
mixedmixed\ArangoDBClient\Documentmixedoptional, an array of options (see below) or the boolean value for $policy (for compatibility prior to version 1.1 of this method):
string\ArangoDBClient\Exception |
|---|
boolean- always true, will throw if there is an errorsaveEdge(mixed $graph, mixed $from, mixed $to, mixed $label= null, mixed $document, string $collection= null) : mixed
This will save the edge to the graph and return the edges-document's id
This will throw if the edge cannot be saved
| since | 1.2 |
|---|
mixedmixedmixedmixedmixedstring\ArangoDBClient\Exception |
|---|
mixed- id of edge createdsaveVertex(mixed $graph, mixed $document, string $collection = null) : string
This will add the vertex-document to the graph and return the vertex id
This will throw if the vertex cannot be saved
| since | 1.2 |
|---|
mixedmixedstring\ArangoDBClient\Exception |
|---|
string- id of vertex createdsetBatchsize(integer $batchsize)
Will be reset after the cursor has been created.
integer
setCacheEnabled(boolean $useCache) : \ArangoDBClient\GraphHandler
| fluent | This method is part of a fluent interface and will return the same instance |
|---|
boolean
\ArangoDBClient\GraphHandlersetCount(integer $count)
Will be reset after the cursor has been created.
integer
setDocumentClass(string $class) : \ArangoDBClient\DocumentClassable
stringDocument class to use
\ArangoDBClient\DocumentClassablesetEdgeClass(string $class) : \ArangoDBClient\DocumentClassable
stringEdge class to use
\ArangoDBClient\DocumentClassablesetLimit(integer $limit)
Will be reset after the cursor has been created.
integer
updateEdge(mixed $graph, mixed $edgeId, mixed $label, \ArangoDBClient\Edge $document, mixed $options= array(), string $collection= null) : boolean
This will update the edge on the server
This will throw if the edge cannot be updated
If policy is set to error (locally or globally through the ConnectionOptions)
and the passed edge-document has a _rev value set, the database will check
that the revision of the to-be-replaced document is the same as the one given.
| since | 1.2 |
|---|
mixedmixedmixed\ArangoDBClient\Edgemixedoptional, array of options (see below)
string\ArangoDBClient\Exception |
|---|
boolean- always true, will throw if there is an errorupdateVertex(mixed $graph, mixed $vertexId, \ArangoDBClient\Document $document, mixed $options= array(), string $collection= null) : boolean
This will update the vertex on the server
This will throw if the vertex cannot be updated
If policy is set to error (locally or globally through the ConnectionOptions)
and the passed vertex-document has a _rev value set, the database will check
that the revision of the to-be-replaced document is the same as the one given.
| since | 1.2 |
|---|
mixedmixed\ArangoDBClient\Documentmixedoptional, an array of options (see below)
string\ArangoDBClient\Exception |
|---|
boolean- always true, will throw if there is an erroraddTransactionHeader(array $headers, mixed $collection)
arraymixedgetConnection() : \ArangoDBClient\Connection
\ArangoDBClient\Connection- the connection objectgetConnectionOption($optionName) : mixed
\ArangoDBClient\ClientException |
|---|
mixed- the option's valueincludeOptionsInBody(array $options, array $body, array $includeArray = array()) : array
Only options that are set in $includeArray will be included. This is only for options that are to be sent to the ArangoDB server in a json body(like 'limit', 'skip', etc...) .
arrayarrayarrayarray$params - array of parameters for use in a urljson_encode_wrapper(array $body) : string
This is a convenience function that calls json_encode_wrapper on the connection
array\ArangoDBClient\ClientException |
|---|
string- json string of the body that was passedmakeCollection(mixed $value) : string
mixed\ArangoDBClient\ClientException |
|---|
string- collection name$_documentClass : string
'\ArangoDBClient\Document'$_edgeClass : string
'\ArangoDBClient\Edge'$cache
$cacheEnabled :
false$_connection
| param |
|---|
$batchsize
$count
$limit
ENTRY_GRAPH = 'graph'
KEY_FROM = '_from'
KEY_TO = '_to'
OPTION_COLLECTION = 'collection'
OPTION_COLLECTIONS = 'collections'
OPTION_DROP_COLLECTION = 'dropCollection'
OPTION_EDGES = 'edges'
OPTION_EDGE_DEFINITION = 'edgeDefinition'
OPTION_EDGE_DEFINITIONS = 'edgeDefinitions'
OPTION_KEY = '_key'
OPTION_NAME = 'name'
OPTION_ORPHAN_COLLECTIONS = 'orphanCollections'
OPTION_REVISION = 'revision'
OPTION_VERTICES = 'vertices'