public
array
|
#
createGraph( triagens\ArangoDb\Graph $graph )
Create a graph
This will create a graph using the given graph object and return an array of the created graph object's attributes.
Parameters
- $graph
- The graph object which holds the information of the graph to be created
Returns
array
Throws
Since
1.2
|
public
triagens\ArangoDb\Graph |false
|
#
getGraph( String $graph, array $options = [] )
Get a graph
This will get a graph.
Parameters
- $graph
- $options
- Options to pass to the method
Returns
Throws
Since
1.2
|
public
|
#
setBatchsize( integer $batchsize )
Sets the batchsize for any method creating a cursor.
Will be reset after the cursor has been created.
Sets the batchsize for any method creating a cursor.
Will be reset after the cursor has been created.
Parameters
|
public
|
#
setCount( integer $count )
Sets the count for any method creating a cursor.
Will be reset after the cursor has been created.
Sets the count for any method creating a cursor.
Will be reset after the cursor has been created.
Parameters
|
public
|
#
setLimit( integer $limit )
Sets the limit for any method creating a cursor.
Will be reset after the cursor has been created.
Sets the limit for any method creating a cursor.
Will be reset after the cursor has been created.
Parameters
|
public
boolean
|
#
properties( mixed $graph )
Get a graph's properties
Parameters
- $graph
- graph name as a string or instance of Graph
Returns
boolean
- Returns an array of attributes. Will throw if there is an error
Throws
Since
1.2
|
public
boolean
|
#
dropGraph( mixed $graph, boolean $dropCollections = true )
Drop a graph and remove all its vertices and edges, also drops vertex and edge collections
Drop a graph and remove all its vertices and edges, also drops vertex and edge collections
Parameters
- $graph
- graph name as a string or instance of Graph
- $dropCollections
- if set to false the graphs collections will not be droped.
Returns
boolean
- always true, will throw if there is an error
Throws
Since
1.2
|
public
triagens\ArangoDb\Graph
|
#
addOrphanCollection( mixed $graph, string $orphanCollection )
add an orphan collection to the graph.
add an orphan collection to the graph.
This will add a further orphan collection to the graph.
Parameters
- $graph
- graph name as a string or instance of Graph
- $orphanCollection
- the orphan collection to be added as string.
Returns
Throws
Since
2.2
|
public
triagens\ArangoDb\Graph
|
#
deleteOrphanCollection( mixed $graph, string $orphanCollection, boolean $dropCollection = false )
deletes an orphan collection from the graph.
deletes an orphan collection from the graph.
This will delete an orphan collection from the graph.
Parameters
- $graph
- graph name as a string or instance of Graph
- $orphanCollection
- the orphan collection to be removed as string.
- $dropCollection
- if set to true the collection is deleted, not just removed from the graph.
Returns
Throws
Since
2.2
|
public
array
|
#
getVertexCollections( mixed $graph, array $options = [] )
gets all vertex collection from the graph.
gets all vertex collection from the graph.
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.
Parameters
- $graph
- graph name as a string or instance of Graph
- $options
- optional, an array of options
<
p>Options are :
- 'excludeOrphans' - boolean value: true to exclude the orphans or false to include orphans in the result.
Defaults to false
Returns
array
Throws
ClientException@since 2.2
|
public
triagens\ArangoDb\Graph
|
#
addEdgeDefinition( mixed $graph, triagens\ArangoDb\EdgeDefinition $edgeDefinition )
adds an edge definition to the graph.
adds an edge definition to the graph.
This will add a further edge definition to the graph.
Parameters
- $graph
- graph name as a string or instance of Graph
- $edgeDefinition
Returns
Throws
Since
2.2
|
public
triagens\ArangoDb\Graph
|
#
deleteEdgeDefinition( mixed $graph, string $edgeDefinition, boolean $dropCollection = false )
deletes an edge definition from the graph.
deletes an edge definition from the graph.
This will delete an edge definition from the graph.
Parameters
- $graph
- graph name as a string or instance of Graph
- $edgeDefinition
- the name of the edge definitions relation.
- $dropCollection
- if set to true the edge definitions collections are deleted.
Returns
Throws
Since
2.2
|
public
array
|
#
getEdgeCollections( mixed $graph )
gets all edge collections from the graph.
gets all edge collections from the graph.
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.
Parameters
- $graph
- graph name as a string or instance of Graph
Returns
array
Throws
Since
2.2
|
public
triagens\ArangoDb\Graph
|
#
replaceEdgeDefinition( mixed $graph, triagens\ArangoDb\EdgeDefinition $edgeDefinition )
replaces an edge definition of the graph.
replaces an edge definition of the graph.
This will replace an edge definition in the graph.
Parameters
- $graph
- graph name as a string or instance of Graph
- $edgeDefinition
Returns
Throws
Since
2.2
|
public
string
|
#
saveVertex( mixed $graph, mixed $document, string $collection = null )
save a vertex to a graph
This will add the vertex-document to the graph and return the vertex id
This will throw if the vertex cannot be saved
Parameters
- $graph
- graph name as a string or instance of Graph
- $document
- the vertex to be added, can be passed as a vertex object or an array
- $collection
- if one uses a graph with more than one vertex collection one must provide
the collection to store the vertex.
Returns
Throws
Since
1.2
|
public
triagens\ArangoDb\Document
|
#
getVertex( mixed $graph, mixed $vertexId, array $options = [], string $collection = null )
Get a single vertex from a graph
Get a single vertex from a graph
This will throw if the vertex cannot be fetched from the server
Parameters
- $graph
- graph name as a string or instance of Graph
- $vertexId
- $options
optional, an array of options:
- _includeInternals - true to include the internal attributes. Defaults to false
- _ignoreHiddenAttributes - true to show hidden attributes. Defaults to false
- $collection
- if one uses a graph with more than one vertex collection one must provide the collection
to load the vertex.
Returns
Throws
Since
1.2
|
public
boolean
|
#
hasVertex( mixed $graph, mixed $vertexId )
Check if a vertex exists
This will call self::getVertex() internally and checks if there
was an exception thrown which represents an 404 request.
Parameters
- $graph
- graph name as a string or instance of Graph
- $vertexId
Returns
boolean
Throws
|
public
boolean
|
#
replaceVertex( mixed $graph, mixed $vertexId, triagens\ArangoDb\Document $document, array $options = [], string $collection = null )
Replace an existing vertex in a graph, identified graph name and vertex id
Replace an existing vertex in a graph, identified graph name and vertex id
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.
Parameters
- $graph
- graph name as a string or instance of Graph
- $vertexId
- the vertex id as string or number
- $document
- the vertex-document to be updated
- $options
optional, an array of options (see below) or the boolean value for $policy (for compatibility prior to version 1.1 of this method):
- revision - revision for conditional updates ('some-revision-id' [use the passed in revision id], false or true [use document's revision])
- policy - update policy to be used in case of conflict ('error', 'last' or NULL [use default])
- waitForSync - can be used to force synchronisation of the document replacement operation to disk even in case that the waitForSync flag had been disabled for the entire collection
- $collection
- if one uses a graph with more than one vertex collection one must provide the collection
Returns
boolean
- always true, will throw if there is an error
Throws
Since
1.2
|
public
boolean
|
#
updateVertex( mixed $graph, mixed $vertexId, triagens\ArangoDb\Document $document, array $options = [], string $collection = null )
Update an existing vertex in a graph, identified by graph name and vertex id
Update an existing vertex in a graph, identified by graph name and vertex id
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.
Parameters
- $graph
- graph name as a string or instance of Graph
- $vertexId
- the vertex id as string or number
- $document
- the patch vertex-document which contains the attributes and values to be updated
- $options
optional, an array of options (see below)
- policy - update policy to be used in case of conflict ('error', 'last' or NULL [use default])
- keepNull - can be used to instruct ArangoDB to delete existing attributes instead setting their values to null. Defaults to true (keep attributes when set to null)
- waitForSync - can be used to force synchronisation of the document update operation to disk even in case that the waitForSync flag had been disabled for the entire collection
- $collection
- if one uses a graph with more than one vertex collection one must provide the collection
Returns
boolean
- always true, will throw if there is an error
Throws
Since
1.2
|
public
boolean
|
#
removeVertex( mixed $graph, mixed $vertexId, mixed $revision = null, array $options = [], string $collection = null )
Remove a vertex from a graph, identified by the graph name and vertex id
Remove a vertex from a graph, identified by the graph name and vertex id
Parameters
- $graph
- graph name as a string or instance of Graph
- $vertexId
- the vertex id as string or number
- $revision
- optional, the revision of the vertex to be deleted
- $options
optional, an array of options (see below) or the boolean value for $policy (for compatibility prior to version 1.1 of this method)
- policy - update policy to be used in case of conflict ('error', 'last' or NULL [use default])
- waitForSync - can be used to force synchronisation of the document removal operation to disk even in case that the waitForSync flag had been disabled for the entire collection
- $collection
- if one uses a graph with more than one vertex collection one must provide the collection
Returns
boolean
- always true, will throw if there is an error
Throws
Since
1.2
|
public
mixed
|
#
saveEdge( mixed $graph, mixed $from, mixed $to, mixed $label, mixed $document, string $collection = null )
save an edge to a graph
This will save the edge to the graph and return the edges-document's id
This will throw if the edge cannot be saved
Parameters
- $graph
- graph name as a string or instance of Graph
- $from
- $to
- $label
- (optional) a label for the edge
- $document
- the edge-document to be added, can be passed as an edge object or an array
- $collection
- if one uses a graph with more than one vertex collection one must provide the collection
Returns
Throws
Since
1.2
|
public
triagens\ArangoDb\Document
|
#
getEdge( mixed $graph, mixed $edgeId, array $options = [], string $collection = null )
Get a single edge from a graph
Get a single edge from a graph
This will throw if the edge cannot be fetched from the server
Parameters
- $graph
- graph name as a string or instance of Graph
- $edgeId
- $options
optional, array of options
- _includeInternals - true to include the internal attributes. Defaults to false
- _ignoreHiddenAttributes - true to show hidden attributes. Defaults to false
- $collection
- if one uses a graph with more than one vertex collection one must provide the collection
Returns
Throws
Since
1.2
|
public
boolean
|
#
hasEdge( mixed $graph, mixed $edgeId )
Check if an edge exists
This will call self::getEdge() internally and checks if there
was an exception thrown which represents an 404 request.
Parameters
- $graph
- graph name as a string or instance of Graph
- $edgeId
Returns
boolean
Throws
|
public
boolean
|
#
replaceEdge( mixed $graph, mixed $edgeId, mixed $label, triagens\ArangoDb\Edge $document, array $options = [], string $collection = null )
Replace an existing edge in a graph, identified graph name and edge id
Replace an existing edge in a graph, identified graph name and edge id
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.
Parameters
- $graph
- graph name as a string or instance of Graph
- $edgeId
- edge id as string or number
- $label
- $document
- edge document to be updated
- $options
optional, array of options (see below) or the boolean value for $policy (for compatibility prior to version 1.1 of this method)
- policy - update policy to be used in case of conflict ('error', 'last' or NULL [use default])
- waitForSync - can be used to force synchronisation of the document replacement operation to disk even in case that the waitForSync flag had been disabled for the entire collection
- $collection
- if one uses a graph with more than one vertex collection one must provide the collection
Returns
boolean
- always true, will throw if there is an error
Throws
Since
1.2
|
public
boolean
|
#
updateEdge( mixed $graph, mixed $edgeId, mixed $label, triagens\ArangoDb\Edge $document, array $options = [], string $collection = null )
Update an existing edge in a graph, identified by graph name and edge id
Update an existing edge in a graph, identified by graph name and edge id
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.
Parameters
- $graph
- graph name as a string or instance of Graph
- $edgeId
- edge id as string or number
- $label
- $document
- patch edge-document which contains the attributes and values to be updated
- $options
optional, array of options (see below)
- policy - update policy to be used in case of conflict ('error', 'last' or NULL [use default])
- keepNull - can be used to instruct ArangoDB to delete existing attributes instead setting their values to null. Defaults to true (keep attributes when set to null)
- waitForSync - can be used to force synchronisation of the document update operation to disk even in case that the waitForSync flag had been disabled for the entire collection
- $collection
- if one uses a graph with more than one vertex collection one must provide the collection
Returns
boolean
- always true, will throw if there is an error
Throws
Since
1.2
|
public
boolean
|
#
removeEdge( mixed $graph, mixed $edgeId, mixed $revision = null, array $options = [], string $collection = null )
Remove a edge from a graph, identified by the graph name and edge id
Remove a edge from a graph, identified by the graph name and edge id
Parameters
- $graph
- graph name as a string or instance of Graph
- $edgeId
- edge id as string or number
- $revision
- optional revision of the edge to be deleted
- $options
optional, array of options (see below) or the boolean value for $policy (for compatibility prior to version 1.1 of this method)
- policy - update policy to be used in case of conflict ('error', 'last' or NULL [use default])
- waitForSync - can be used to force synchronisation of the document removal operation to disk even in case that the waitForSync flag had been disabled for the entire collection
- $collection
- if one uses a graph with more than one vertex collection one must provide the collection
Returns
boolean
- always true, will throw if there is an error
Throws
Since
1.2
|
public
|
#
clearCache( )
Clears the GraphHandler's cache
Clears the GraphHandler's cache
Returns
$this
|
public
boolean
|
#
getCacheEnabled( )
Checks if caching in enabled
Checks if caching in enabled
Returns
boolean
|
public
|
|