Constants

ENTRY_GRAPH

ENTRY_GRAPH

documents array index

OPTION_REVISION

OPTION_REVISION

conditional update of edges or vertices

OPTION_VERTICES

OPTION_VERTICES

vertex parameter

OPTION_EDGES

OPTION_EDGES

direction parameter

OPTION_KEY

OPTION_KEY

direction parameter

OPTION_COLLECTION

OPTION_COLLECTION

collection parameter

OPTION_COLLECTIONS

OPTION_COLLECTIONS

collections parameter

KEY_FROM

KEY_FROM

example parameter

KEY_TO

KEY_TO

example parameter

OPTION_NAME

OPTION_NAME

name parameter

OPTION_EDGE_DEFINITION

OPTION_EDGE_DEFINITION

edge defintion parameter

OPTION_EDGE_DEFINITIONS

OPTION_EDGE_DEFINITIONS

edge defintions parameter

OPTION_ORPHAN_COLLECTIONS

OPTION_ORPHAN_COLLECTIONS

orphan collection parameter

OPTION_DROP_COLLECTION

OPTION_DROP_COLLECTION

drop collection

Properties

$_connection

$_connection : 

Connection object

Type

$batchsize

$batchsize : 

batchsize

Type

$count

$count : 

count

Type

$limit

$limit : 

limit

Type

Methods

setBatchsize()

setBatchsize(integer $batchsize)

Sets the batchsize for any method creating a cursor.

Will be reseted after the cursor has been created.

Parameters

integer $batchsize

setCount()

setCount(integer $count)

Sets the count for any method creating a cursor.

Will be reseted after the cursor has been created.

Parameters

integer $count

setLimit()

setLimit(integer $limit)

Sets the limit for any method creating a cursor.

Will be reseted after the cursor has been created.

Parameters

integer $limit

createGraph()

createGraph(\triagens\ArangoDb\Graph $graph) : array

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

\triagens\ArangoDb\Graph $graph
  • The graph object which holds the information of the graph to be created

Throws

\triagens\ArangoDb\Exception

Returns

array

getGraph()

getGraph(String $graph, array $options) : \triagens\ArangoDb\Graph

Get a graph

This will get a graph.

Parameters

String $graph
  • The name of the graph
array $options
  • Options to pass to the method

Throws

\triagens\ArangoDb\Exception

Returns

\triagens\ArangoDb\Graph

dropGraph()

dropGraph(mixed $graph, boolean $dropCollections) : boolean

Drop a graph and remove all its vertices and edges, also drops vertex and edge collections<br><br>

Parameters

mixed $graph
  • graph name as a string or instance of Graph
boolean $dropCollections
  • if set to false the graphs collections will not be droped.

Throws

\triagens\ArangoDb\Exception

Returns

boolean —
  • always true, will throw if there is an error

properties()

properties(mixed $graph) : boolean

Get a graph's properties<br><br>

Parameters

mixed $graph
  • graph name as a string or instance of Graph

Throws

\triagens\ArangoDb\Exception

Returns

boolean —
  • Returns an array of attributes. Will throw if there is an error

addOrphanCollection()

addOrphanCollection(mixed $graph, string $orphanCollection) : \triagens\ArangoDb\Graph

add an orphan collection to the graph.

This will add a further orphan collection to the graph.

Parameters

mixed $graph
  • graph name as a string or instance of Graph
string $orphanCollection
  • the orphan collection to be added as string.

Throws

\triagens\ArangoDb\Exception

Returns

\triagens\ArangoDb\Graph

deleteOrphanCollection()

deleteOrphanCollection(mixed $graph, string $orphanCollection, boolean $dropCollection) : \triagens\ArangoDb\Graph

deletes an orphan collection from the graph.

This will delete an orphan collection from the graph.

Parameters

mixed $graph
  • graph name as a string or instance of Graph
string $orphanCollection
  • the orphan collection to be removed as string.
boolean $dropCollection
  • if set to true the collection is deleted, not just removed from the graph.

Throws

\triagens\ArangoDb\Exception

Returns

\triagens\ArangoDb\Graph

getVertexCollections()

getVertexCollections(mixed $graph) : array

gets all vertex collection from the graph.

This will get all vertex collection (orphans and used in edge definitions) from the graph.

Parameters

mixed $graph
  • graph name as a string or instance of Graph

Throws

\triagens\ArangoDb\Exception

Returns

array

addEdgeDefinition()

addEdgeDefinition(mixed $graph, \triagens\ArangoDb\EdgeDefinition $edgeDefinition) : \triagens\ArangoDb\Graph

adds an edge definition to the graph.

This will add a further edge definition to the graph.

Parameters

mixed $graph
  • graph name as a string or instance of Graph
\triagens\ArangoDb\EdgeDefinition $edgeDefinition
  • the new edge definition.

Throws

\triagens\ArangoDb\Exception

Returns

\triagens\ArangoDb\Graph

deleteEdgeDefinition()

deleteEdgeDefinition(mixed $graph, string $edgeDefinition, boolean $dropCollection) : \triagens\ArangoDb\Graph

deletes an edge definition from the graph.

This will delete an edge definition from the graph.

Parameters

mixed $graph
  • graph name as a string or instance of Graph
string $edgeDefinition
  • the name of the edge definitions relation.
boolean $dropCollection
  • if set to true the edge definitions collections are deleted.

Throws

\triagens\ArangoDb\Exception

Returns

\triagens\ArangoDb\Graph

getEdgeCollections()

getEdgeCollections(mixed $graph) : \triagens\ArangoDb\array()

gets all edge collections from the graph.

This will get all edge collections from the graph.

Parameters

mixed $graph
  • graph name as a string or instance of Graph

Throws

\triagens\ArangoDb\Exception

Returns

\triagens\ArangoDb\array()

replaceEdgeDefinition()

replaceEdgeDefinition(mixed $graph, \triagens\ArangoDb\EdgeDefinition $edgeDefinition) : \triagens\ArangoDb\Graph

replaces an edge definition of the graph.

This will replace an edge definition in the graph.

Parameters

mixed $graph
  • graph name as a string or instance of Graph
\triagens\ArangoDb\EdgeDefinition $edgeDefinition
  • the edge definition.

Throws

\triagens\ArangoDb\Exception

Returns

\triagens\ArangoDb\Graph

saveVertex()

saveVertex(mixed $graph, mixed $document, string $collection) : string

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

mixed $graph
  • graph name as a string or instance of Graph
mixed $document
  • the vertex to be added, can be passed as a vertex object or an array
string $collection
  • if one uses a graph with more than one vertex collection one must provide the collection to store the vertex.

Throws

\triagens\ArangoDb\Exception

Returns

string —
  • id of vertex created

getVertex()

getVertex(mixed $graph, mixed $vertexId, array $options, string $collection) : \triagens\ArangoDb\Document

Get a single vertex from a graph

This will throw if the vertex cannot be fetched from the server

Parameters

mixed $graph
  • graph name as a string or instance of Graph
mixed $vertexId
  • the vertex identifier
array $options

optional, an array of options:

  • _includeInternals - true to include the internal attributes. Defaults to false
  • includeInternals - Deprecated, please use '_includeInternals'.
  • _ignoreHiddenAttributes - true to show hidden attributes. Defaults to false
  • ignoreHiddenAttributes - Deprecated, please use '_ignoreHiddenAttributes'.
  • string $collection
    • if one uses a graph with more than one vertex collection one must provide the collection to load the vertex.

    Throws

    \triagens\ArangoDb\Exception

    Returns

    \triagens\ArangoDb\Document

    replaceVertex()

    replaceVertex(mixed $graph, mixed $vertexId, \triagens\ArangoDb\Document $document, mixed $options, string $collection) : boolean

    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

    mixed $graph
    • graph name as a string or instance of Graph
    mixed $vertexId
    • the vertex id as string or number
    \triagens\ArangoDb\Document $document
    • the vertex-document to be updated
    mixed $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
  • string $collection
    • if one uses a graph with more than one vertex collection one must provide the collection

    Throws

    \triagens\ArangoDb\Exception

    Returns

    boolean —
    • always true, will throw if there is an error

    updateVertex()

    updateVertex(mixed $graph, mixed $vertexId, \triagens\ArangoDb\Document $document, mixed $options, string $collection) : boolean

    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

    mixed $graph
    • graph name as a string or instance of Graph
    mixed $vertexId
    • the vertex id as string or number
    \triagens\ArangoDb\Document $document
    • the patch vertex-document which contains the attributes and values to be updated
    mixed $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
  • string $collection
    • if one uses a graph with more than one vertex collection one must provide the collection

    Throws

    \triagens\ArangoDb\Exception

    Returns

    boolean —
    • always true, will throw if there is an error

    removeVertex()

    removeVertex(mixed $graph, mixed $vertexId, mixed $revision, mixed $options, string $collection) : boolean

    Remove a vertex from a graph, identified by the graph name and vertex id<br><br>

    Parameters

    mixed $graph
    • graph name as a string or instance of Graph
    mixed $vertexId
    • the vertex id as string or number
    mixed $revision
    • optional, the revision of the vertex to be deleted
    mixed $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
  • string $collection
    • if one uses a graph with more than one vertex collection one must provide the collection

    Throws

    \triagens\ArangoDb\Exception

    Returns

    boolean —
    • always true, will throw if there is an error

    saveEdge()

    saveEdge(mixed $graph, mixed $from, mixed $to, mixed $label, mixed $document, string $collection) : mixed

    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

    mixed $graph
    • graph name as a string or instance of Graph
    mixed $from
    • the 'from' vertex
    mixed $to
    • the 'to' vertex
    mixed $label
    • (optional) a label for the edge
    mixed $document
    • the edge-document to be added, can be passed as an edge object or an array
    string $collection
    • if one uses a graph with more than one vertex collection one must provide the collection

    Throws

    \triagens\ArangoDb\Exception

    Returns

    mixed —
    • id of edge created

    getEdge()

    getEdge(mixed $graph, mixed $edgeId, array $options, string $collection) : \triagens\ArangoDb\Document

    Get a single edge from a graph

    This will throw if the edge cannot be fetched from the server

    Parameters

    mixed $graph
    • graph name as a string or instance of Graph
    mixed $edgeId
    • edge identifier
    array $options

    optional, array of options

  • _includeInternals - true to include the internal attributes. Defaults to false
  • includeInternals - Deprecated, please use '_includeInternals'.
  • _ignoreHiddenAttributes - true to show hidden attributes. Defaults to false
  • ignoreHiddenAttributes - Deprecated, please use '_ignoreHiddenAttributes'.
  • string $collection
    • if one uses a graph with more than one vertex collection one must provide the collection

    Throws

    \triagens\ArangoDb\Exception

    Returns

    \triagens\ArangoDb\Document
    • the edge document fetched from the server

    replaceEdge()

    replaceEdge(mixed $graph, mixed $edgeId, mixed $label, \triagens\ArangoDb\Edge $document, mixed $options, string $collection) : boolean

    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

    mixed $graph
    • graph name as a string or instance of Graph
    mixed $edgeId
    • edge id as string or number
    mixed $label
    • label for the edge or ''
    \triagens\ArangoDb\Edge $document
    • edge document to be updated
    mixed $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
  • string $collection
    • if one uses a graph with more than one vertex collection one must provide the collection

    Throws

    \triagens\ArangoDb\Exception

    Returns

    boolean —
    • always true, will throw if there is an error

    updateEdge()

    updateEdge(mixed $graph, mixed $edgeId, mixed $label, \triagens\ArangoDb\Edge $document, mixed $options, string $collection) : boolean

    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

    mixed $graph
    • graph name as a string or instance of Graph
    mixed $edgeId
    • edge id as string or number
    mixed $label
    • label for the edge or ''
    \triagens\ArangoDb\Edge $document
    • patch edge-document which contains the attributes and values to be updated
    mixed $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
  • string $collection
    • if one uses a graph with more than one vertex collection one must provide the collection

    Throws

    \triagens\ArangoDb\Exception

    Returns

    boolean —
    • always true, will throw if there is an error

    removeEdge()

    removeEdge(mixed $graph, mixed $edgeId, mixed $revision, mixed $options, string $collection) : boolean

    Remove a edge from a graph, identified by the graph name and edge id<br><br>

    Parameters

    mixed $graph
    • graph name as a string or instance of Graph
    mixed $edgeId
    • edge id as string or number
    mixed $revision
    • optional revision of the edge to be deleted
    mixed $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
  • string $collection
    • if one uses a graph with more than one vertex collection one must provide the collection

    Throws

    \triagens\ArangoDb\Exception

    Returns

    boolean —
    • always true, will throw if there is an error

    getNeighborVertices()

    getNeighborVertices(mixed $graph, mixed $vertexExample, boolean|array $options) : \triagens\ArangoDb\Cursor

    Get neighboring vertices of a given vertex

    This method accepts multiple argument types for the vertex examples, these can be:

  • a vertex id
  • 'null' to select every vertex
  • an array containing key value pairs that must match a vertex
  • an array of arrays containing key value pairs that must match a vertex. This example means that you can define filters and combine them with "or".


  • Parameters

    mixed $graph
    • graph name as a string or instance of Graph
    mixed $vertexExample
    • see functions introduction
    boolean|array $options

    an array of optional parameters:

    • batchSize - the batch size of the returned cursor (deprecated, use 'setBatchsize' instead)
    • limit - limit the result size by a give number (deprecated, use 'setLimit' instead)
    • count - return the total number of results Defaults to false (deprecated, use 'setCount' instead)
    • filter - a optional filter
      • Filter options are :
      • direction - Filter for inbound (value "in") or outbound (value "out") neighbors. Default value is "any".
      • labels - filter by an array of edge labels (empty array means no restriction).
      • properties - filter neighbors by an array of edge properties
        • Properties options are :
        • key - Filter the result vertices by a key value pair.
        • value - The value of the key.
        • compare - A comparison operator. (==, >, <, >=, <= )
    • minDepth - Defines the minimal length of a path from an edge to a vertex (default is 1, which means only the edges directly connected to a vertex would be returned).
    • maxDepth - Defines the maximal length of a path from an edge to a vertex (default is 1, which means only the edges directly connected to a vertex would be returned).
    • _sanitize - True to remove _id and _rev attributes from result documents. Defaults to false.
    • sanitize - Deprecated, please use '_sanitize'.
    • _hiddenAttributes - Set an array of hidden attributes for created documents.
    • hiddenAttributes - Deprecated, please use '_hiddenAttributes'.
      • This is actually the same as setting hidden attributes using setHiddenAttributes() on a document.
        The difference is, that if you're returning a resultset of documents, the getAll() is already called
        and the hidden attributes would not be applied to the attributes.

    Throws

    \triagens\ArangoDb\Exception

    Returns

    \triagens\ArangoDb\Cursor

    getConnectedEdges()

    getConnectedEdges(mixed $graph, mixed $vertexId, boolean|array $options) : \triagens\ArangoDb\Cursor

    Get connected edges of a given vertex

    This will throw if the list cannot be fetched from the server

    Parameters

    mixed $graph
    • graph name as a string or instance of Graph
    mixed $vertexId
    • the vertex id
    boolean|array $options
    • an array of optional parameters:

      • batchSize - the batch size of the returned cursor (deprecated, use 'setBatchsize' instead)
      • limit - limit the result size by a give number (deprecated, use 'setLimit' instead)
      • count - return the total number of results Defaults to false (deprecated, use 'setCount' instead)
      • filter - a optional filter
        • Filter options are :
        • direction - Filter for inbound (value "in") or outbound (value "out") neighbors. Default value is "any".
        • labels - filter by an array of edge labels (empty array means no restriction).
        • properties - filter neighbors by an array of edge properties
          • Properties options are :
          • key - Filter the result vertices by a key value pair.
          • value - The value of the key.
          • compare - A comparison operator. (==, >, <, >=, <= )
      • minDepth - Defines the minimal length of a path from an edge to a vertex (default is 1, which means only the edges directly connected to a vertex would be returned).
      • maxDepth - Defines the maximal length of a path from an edge to a vertex (default is 1, which means only the edges directly connected to a vertex would be returned).
      • _sanitize - True to remove _id and _rev attributes from result documents. Defaults to false.
      • sanitize - Deprecated, please use '_sanitize'.
      • _hiddenAttributes - Set an array of hidden attributes for created documents.
      • hiddenAttributes - Deprecated, please use '_hiddenAttributes'.
        • This is actually the same as setting hidden attributes using setHiddenAttributes() on a document.
          The difference is, that if you're returning a resultset of documents, the getAll() is already called
          and the hidden attributes would not be applied to the attributes.

    Throws

    \triagens\ArangoDb\Exception

    Returns

    \triagens\ArangoDb\Cursor

    getVertices()

    getVertices(mixed $graph, boolean|array $options) : \triagens\ArangoDb\Cursor

    Get all vertices of a graph

    This will throw if the list cannot be fetched from the server

    Parameters

    mixed $graph
    • graph name as a string or instance of Graph
    boolean|array $options
    • an array of optional parameters:

      • batchSize - the batch size of the returned cursor (deprecated, use 'setBatchsize' instead)
      • limit - limit the result size by a give number (deprecated, use 'setLimit' instead)
      • count - return the total number of results Defaults to false (deprecated, use 'setCount' instead)
      • filter - a optional filter
        • Filter options are :
        • properties - filter neighbors by an array of edge properties
          • Properties options are :
          • key - Filter the result vertices by a key value pair.
          • value - The value of the key.
          • compare - A comparison operator. (==, >, <, >=, <= )
      • _sanitize - True to remove _id and _rev attributes from result documents. Defaults to false.
      • sanitize - Deprecated, please use '_sanitize'.
      • _hiddenAttributes - Set an array of hidden attributes for created documents.
      • hiddenAttributes - Deprecated, please use '_hiddenAttributes'.
        • This is actually the same as setting hidden attributes using setHiddenAttributes() on a document.
          The difference is, that if you're returning a resultset of documents, the getAll() is already called
          and the hidden attributes would not be applied to the attributes.

    Throws

    \triagens\ArangoDb\Exception

    Returns

    \triagens\ArangoDb\Cursor

    getEdges()

    getEdges(mixed $graph, boolean|array $options) : \triagens\ArangoDb\Cursor

    Get edges of a graph

    This will throw if the list cannot be fetched from the server

    Parameters

    mixed $graph
    • graph name as a string or instance of Graph
    boolean|array $options
    • an array of optional parameters:

      • batchSize - the batch size of the returned cursor (deprecated, use 'setBatchsize' instead)
      • limit - limit the result size by a give number (deprecated, use 'setLimit' instead)
      • count - return the total number of results Defaults to false (deprecated, use 'setCount' instead)
      • filter - a optional filter
        • Filter options are :
        • properties - filter neighbors by an array of edge properties
        • labels - filter by an array of edge labels (empty array means no restriction).
          • Properties options are :
          • key - Filter the result edges by a key value pair.
          • value - The value of the key.
          • compare - A comparison operator. (==, >, <, >=, <= )
      • vertexExample - An example for the desired vertices.
      • direction - The direction of the edges as a string. Possible values are *outbound*, *inbound* and *any* (default).
      • edgeCollectionRestriction* - One or multiple edge collection names. Only edges from these collections will be considered for the path.
      • vertexCollectionRestriction* - One or multiple vertex collection names. Only vertices from these collections will be considered as start vertex of a path.
      • minDepth - Defines the minimal length of a path from an edge to a vertex (default is 1, which means only the edges directly connected to a vertex would be returned).
      • maxDepth - Defines the maximal length of a path from an edge to a vertex (default is 1, which means only the edges directly connected to a vertex would be returned).
      • _sanitize - True to remove _id and _rev attributes from result documents. Defaults to false.
      • sanitize - Deprecated, please use '_sanitize'.
      • _hiddenAttributes - Set an array of hidden attributes for created documents.
      • hiddenAttributes - Deprecated, please use '_hiddenAttributes'.
        • This is actually the same as setting hidden attributes using setHiddenAttributes() on a document.
          The difference is, that if you're returning a resultset of documents, the getAll() is already called
          and the hidden attributes would not be applied to the attributes.

    Throws

    \triagens\ArangoDb\Exception

    Returns

    \triagens\ArangoDb\Cursor

    getPaths()

    getPaths(mixed $graph, boolean|array $options) : \triagens\ArangoDb\Cursor

    Get all pathes of a graph

    This will throw if the list cannot be fetched from the server

    Parameters

    mixed $graph
    • graph name as a string or instance of Graph
    boolean|array $options
    • an array of optional parameters:

      • batchSize - the batch size of the returned cursor (deprecated, use 'setBatchsize' instead)
      • limit - limit the result size by a give number (deprecated, use 'setLimit' instead)
      • count - return the total number of results Defaults to false (deprecated, use 'setCount' instead)
      • direction - The direction of the edges as a string. Possible values are *outbound*, *inbound* and *any* (default).
      • followCycles* - If set to *true* the query follows cycles in the graph, default is false.
      • minDepth - Defines the minimal length of a path from an edge to a vertex (default is 1, which means only the edges directly connected to a vertex would be returned).
      • maxDepth - Defines the maximal length of a path from an edge to a vertex (default is 1, which means only the edges directly connected to a vertex would be returned).

    Throws

    \triagens\ArangoDb\Exception

    Returns

    \triagens\ArangoDb\Cursor

    getShortestPaths()

    getShortestPaths(mixed $graph, mixed $startVertexExample, mixed $endVertexExample, boolean|array $options) : \triagens\ArangoDb\Cursor

    Get the shortest pathes of a graph

    This will throw if the list cannot be fetched from the server This method accepts multiple argument types for the vertex examples, these can be:

  • a vertex id
  • null to select every vertex
  • an array containing key value pairs that must match a vertex
  • an array of arrays containing key value pairs that must match a vertex. This example means that you can define filters and combine them with "or".


  • Parameters

    mixed $graph
    • graph name as a string or instance of Graph
    mixed $startVertexExample
    • see functions introduction
    mixed $endVertexExample
    • see functions introduction
    boolean|array $options
    • an array of optional parameters:

      • batchSize - the batch size of the returned cursor (deprecated, use 'setBatchsize' instead)
      • limit - limit the result size by a give number (deprecated, use 'setLimit' instead)
      • count - return the total number of results Defaults to false (deprecated, use 'setCount' instead)
      • direction - The direction of the edges as a string. Possible values are *outbound*, *inbound* and *any* (default).
      • edgeCollectionRestriction - One or multiple edge collection names. Only edges from these collections will be considered for the path.
      • startVertexCollectionRestriction - One or multiple vertex collection names. Only vertices from these collections will be considered as start vertex of a path.
      • endVertexCollectionRestriction - One or multiple vertex collection names. Only vertices from these collections will be considered as end vertex of a path.
      • edgeExamples' - A filter example for the edges in the shortest paths, see introduction.
      • algorithm - The algorithm to calculate the shortest paths. If both start and end vertex examples are empty Floyd-Warshall is used, otherwise the default is Dijkstra.
      • weight' - The name of the attribute of the edges containing the length as a string.
      • defaultWeight' - Only used with the option *weight*. If an edge does not have the attribute named as defined in option *weight* this default.

    Throws

    \triagens\ArangoDb\Exception

    Returns

    \triagens\ArangoDb\Cursor

    getDistanceTo()

    getDistanceTo(mixed $graph, mixed $startVertexExample, mixed $endVertexExample, boolean|array $options) : \triagens\ArangoDb\Cursor

    Gets the distance of vertex pairs of a graph

    This will throw if the list cannot be fetched from the server

    Parameters

    mixed $graph
    • graph name as a string or instance of Graph
    mixed $startVertexExample
    • see functions introduction
    mixed $endVertexExample
    • see functions introduction
    boolean|array $options
    • an array of optional parameters:

    Throws

    \triagens\ArangoDb\Exception

    Returns

    \triagens\ArangoDb\Cursor

    getCommonNeighborVertices()

    getCommonNeighborVertices(mixed $graph, mixed $vertex1Example, mixed $vertex2Example, array $options1, array $options2) : \triagens\ArangoDb\Cursor

    Get common neighboring vertices of 2 gicen vertices.

    This will throw if the list cannot be fetched from the server

    This method returns the intersection of the result of 'getNeighborVertices.' This method accepts a different set of options than 'getNeighborVertices.'

    Parameters

    mixed $graph
    • graph name as a string or instance of Graph
    mixed $vertex1Example
    • see 'getNeighborVertices'
    mixed $vertex2Example
    • see 'getNeighborVertices'
    array $options1
    • see '$options2'.
    array $options2
    • an array of optional parameters:

      • direction - "any" or "inbound" (or "in") or "outbound" (or "out") . Default value is "any".
      • edgeExamples - A filter example for the edges, see $vertex1Example
      • neighborExamples - A filter example for the neighbors, see $vertex1Example
      • edgeCollectionRestriction - One or multiple edge collection names. Only edges from these collections will be considered for the path.
      • vertexCollectionRestriction - One or multiple vertex collection names. Only vertices from these collections will be considered as start vertex of a path.
      • minDepth - Defines the minimal length of a path from an edge to a vertex (default is 1, which means only the edges directly connected to a vertex would be returned).
      • maxDepth - Defines the maximal length of a path from an edge to a vertex (default is 1, which means only the edges directly connected to a vertex would be returned).

    Throws

    \triagens\ArangoDb\Exception

    Returns

    \triagens\ArangoDb\Cursor

    getCommonProperties()

    getCommonProperties(mixed $graph, mixed $vertex1Example, mixed $vertex2Example, array $options) : \triagens\ArangoDb\Cursor

    Get vertices with common properties.

    This will throw if the list cannot be fetched from the server

    This method accepts multiple argument types for the vertex examples, these can be:

  • a vertex id
  • null select every vertex
  • an array containing key value pairs that must match a vertex
  • an array of arrays containing key value pairs that must match a vertex. This example means that you can define filters and combine them with "or".


  • Parameters

    mixed $graph
    • graph name as a string or instance of Graph
    mixed $vertex1Example
    • see 'getNeighborVertices'
    mixed $vertex2Example
    • see 'getNeighborVertices'
    array $options
    • see 'options' description.

      • vertex1CollectionRestriction - One or multiple vertex collection names. Only vertices from these collections will be considered.
      • vertex2CollectionRestriction - One or multiple vertex collection names. Only vertices from these collections will be considered.
      • ignoreProperties - One or multiple attributes of a document that should be ignored, either a string or an array.

    Throws

    \triagens\ArangoDb\Exception

    Returns

    \triagens\ArangoDb\Cursor

    getAbsoluteEccentricity()

    getAbsoluteEccentricity(mixed $graph, mixed $vertexExample, boolean|array $options) : array

    Get the absolute <a href="http://en.wikipedia.org/wiki/Distance_%28graph_theory%29">eccentricity</a> of a graph.

    This will throw if the list cannot be fetched from the server This does not support 'batchsize', 'limit' and 'count'. This method accepts multiple argument types for the vertex examples, these can be:

  • a vertex id
  • null select every vertex
  • an array containing key value pairs that must match a vertex
  • an array of arrays containing key value pairs that must match a vertex. This example means that you can define filters and combine them with "or".


  • Parameters

    mixed $graph
    • graph name as a string or instance of Graph
    mixed $vertexExample
    • see functions introduction
    boolean|array $options
    • an array of optional parameters:

      • direction - The direction of the edges as a string. Possible values are *outbound*, *inbound* and *any* (default).
      • edgeCollectionRestriction - One or multiple edge collection names. Only edges from these collections will be considered for the path.
      • startVertexCollectionRestriction - One or multiple vertex collection names. Only vertices from these collections will be considered as start vertex of a path.
      • endVertexCollectionRestriction - One or multiple vertex collection names. Only vertices from these collections will be considered as end vertex of a path.
      • edgeExamples - A filter example for the edges in the shortest paths, see introduction.
      • algorithm - The algorithm to calculate the shortest paths. If both start and end vertex examples are empty Floyd-Warshall is used, otherwise the default is Dijkstra.
      • weight - The name of the attribute of the edges containing the length as a string.
      • defaultWeight - Only used with the option *weight*. If an edge does not have the attribute named as defined in option *weight* this default.

    Throws

    \triagens\ArangoDb\Exception

    Returns

    array

    getEccentricity()

    getEccentricity(mixed $graph, boolean|array $options) : array

    Get the <a href="http://en.wikipedia.org/wiki/Distance_%28graph_theory%29">eccentricity</a> of a graph.

    This will throw if the list cannot be fetched from the server This does not support 'batchsize', 'limit' and 'count'.

    Parameters

    mixed $graph
    • graph name as a string or instance of Graph
    boolean|array $options
    • an array of optional parameters:

      • direction - The direction of the edges as a string.
      • Possible values are *outbound*, *inbound* and *any* (default).
      • algorithm - The algorithm to calculate the shortest paths. If both start and end vertex examples are empty Floyd-Warshall is used, otherwise the default is Dijkstra.
      • weight - The name of the attribute of the edges containing the length as a string.
      • defaultWeight - Only used with the option *weight*. If an edge does not have the attribute named as defined in option *weight* this default.

    Throws

    \triagens\ArangoDb\Exception

    Returns

    array

    getAbsoluteCloseness()

    getAbsoluteCloseness(mixed $graph, mixed $vertexExample, boolean|array $options) : array

    Get the absolute <a href="http://en.wikipedia.org/wiki/Centrality#Closeness_centrality">closeness</a> of a graph.

    This will throw if the list cannot be fetched from the server This does not support 'batchsize', 'limit' and 'count'. This method accepts multiple argument types for the vertex examples, these can be:

  • a vertex id
  • null select every vertex
  • an array containing key value pairs that must match a vertex
  • an array of arrays containing key value pairs that must match a vertex. This example means that you can define filters and combine them with "or".


  • Parameters

    mixed $graph
    • graph name as a string or instance of Graph
    mixed $vertexExample
    • see functions introduction
    boolean|array $options
    • an array of optional parameters:

      • direction - The direction of the edges as a string. Possible values are *outbound*, *inbound* and *any* (default).
      • edgeCollectionRestriction - One or multiple edge collection names. Only edges from these collections will be considered for the path.
      • startVertexCollectionRestriction - One or multiple vertex collection names. Only vertices from these collections will be considered as start vertex of a path.
      • endVertexCollectionRestriction - One or multiple vertex collection names. Only vertices from these collections will be considered as end vertex of a path.
      • edgeExamples - A filter example for the edges in the shortest paths, see introduction.
      • algorithm - The algorithm to calculate the shortest paths. If both start and end vertex examples are empty Floyd-Warshall is used, otherwise the default is Dijkstra.
      • weight - The name of the attribute of the edges containing the length as a string.
      • defaultWeight - Only used with the option *weight*. If an edge does not have the attribute named as defined in option *weight* this default.

    Throws

    \triagens\ArangoDb\Exception

    Returns

    array

    getCloseness()

    getCloseness(mixed $graph, boolean|array $options) : array

    Get the <a href="http://en.wikipedia.org/wiki/Centrality#Closeness_centrality">closeness</a> of a graph.

    This will throw if the list cannot be fetched from the server This does not support 'batchsize', 'limit' and 'count'.

    Parameters

    mixed $graph
    • graph name as a string or instance of Graph
    boolean|array $options
    • an array of optional parameters:

      • direction - The direction of the edges as a string. Possible values are *outbound*, *inbound* and *any* (default).
      • algorithm - The algorithm to calculate the shortest paths. If both start and end vertex examples are empty Floyd-Warshall is used, otherwise the default is Dijkstra.
      • weight - The name of the attribute of the edges containing the length as a string.
      • defaultWeight - Only used with the option *weight*. If an edge does not have the attribute named as defined in option *weight* this default.

    Throws

    \triagens\ArangoDb\Exception

    Returns

    array

    getAbsoluteBetweenness()

    getAbsoluteBetweenness(mixed $graph, boolean|array $options) : array

    Get the absolute <a href="http://en.wikipedia.org/wiki/Betweenness_centrality">betweenness</a> of a graph.

    This will throw if the list cannot be fetched from the server This does not support 'batchsize', 'limit' and 'count'.

    Parameters

    mixed $graph
    • graph name as a string or instance of Graph
    boolean|array $options
    • an array of optional parameters:

      • direction - The direction of the edges as a string. Possible values are *outbound*, *inbound* and *any* (default).
      • algorithm - The algorithm to calculate the shortest paths. If both start and end vertex examples are empty Floyd-Warshall is used, otherwise the default is Dijkstra.
      • weight - The name of the attribute of the edges containing the length as a string.
      • defaultWeight - Only used with the option *weight*. If an edge does not have the attribute named as defined in option *weight* this default.

    Throws

    \triagens\ArangoDb\Exception

    Returns

    array

    getBetweenness()

    getBetweenness(mixed $graph, boolean|array $options) : array

    Get the <a href="http://en.wikipedia.org/wiki/Betweenness_centrality">betweenness</a> of a graph.

    This will throw if the list cannot be fetched from the server This does not support 'batchsize', 'limit' and 'count'.

    Parameters

    mixed $graph
    • graph name as a string or instance of Graph
    boolean|array $options
    • an array of optional parameters:

      • direction - The direction of the edges as a string. Possible values are *outbound*, *inbound* and *any* (default).
      • algorithm - The algorithm to calculate the shortest paths. If both start and end vertex examples are empty Floyd-Warshall is used, otherwise the default is Dijkstra.
      • weight - The name of the attribute of the edges containing the length as a string.
      • defaultWeight - Only used with the option *weight*. If an edge does not have the attribute named as defined in option *weight* this default.

    Throws

    \triagens\ArangoDb\Exception

    Returns

    array

    getRadius()

    getRadius(mixed $graph, boolean|array $options) : double

    Get the <a href="http://en.wikipedia.org/wiki/Eccentricity_%28graph_theory%29">radius</a> of a graph.

    This will throw if the list cannot be fetched from the server This does not support 'batchsize', 'limit' and 'count'.

    Parameters

    mixed $graph
    • graph name as a string or instance of Graph
    boolean|array $options
    • an array of optional parameters:

      • direction - The direction of the edges as a string. Possible values are *outbound*, *inbound* and *any* (default).
      • algorithm - The algorithm to calculate the shortest paths. If both start and end vertex examples are empty Floyd-Warshall is used, otherwise the default is Dijkstra.
      • weight - The name of the attribute of the edges containing the length as a string.
      • defaultWeight - Only used with the option *weight*. If an edge does not have the attribute named as defined in option *weight* this default.

    Throws

    \triagens\ArangoDb\Exception

    Returns

    double

    getDiameter()

    getDiameter(mixed $graph, boolean|array $options) : double

    Get the <a href="http://en.wikipedia.org/wiki/Eccentricity_%28graph_theory%29">diameter</a> of a graph.

    This will throw if the list cannot be fetched from the server This does not support 'batchsize', 'limit' and 'count'.

    Parameters

    mixed $graph
    • graph name as a string or instance of Graph
    boolean|array $options
    • an array of optional parameters:

      • direction - The direction of the edges as a string. Possible values are *outbound*, *inbound* and *any* (default).
      • algorithm - The algorithm to calculate the shortest paths. If both start and end vertex examples are empty Floyd-Warshall is used, otherwise the default is Dijkstra.
      • weight - The name of the attribute of the edges containing the length as a string.
      • defaultWeight - Only used with the option *weight*. If an edge does not have the attribute named as defined in option *weight* this default.

    Throws

    \triagens\ArangoDb\Exception

    Returns

    double

    getConnection()

    getConnection() : \triagens\ArangoDb\Connection

    Return the connection object

    Returns

    \triagens\ArangoDb\Connection
    • the connection object

    getConnectionOption()

    getConnectionOption( $optionName) : mixed

    Return a connection option This is a convenience function that calls json_encode_wrapper on the connection

    Parameters

    $optionName
    • The option to return a value for

    Returns

    mixed —
    • the option's value

    getCursorOptions()

    getCursorOptions(mixed $options) : array

    Return an array of cursor options

    Parameters

    mixed $options
    • $options might be a boolean sanitize value, or an array of options, with or without a '_sanitize' key.

    Returns

    array —
    • array of options

    json_encode_wrapper()

    json_encode_wrapper(array $body) : string

    Return a json encoded string for the array passed.

    This is a convenience function that calls json_encode_wrapper on the connection

    Parameters

    array $body
    • The body to encode into json

    Returns

    string —
    • json string of the body that was passed

    validateAndIncludeOldSingleParameterInParams()

    validateAndIncludeOldSingleParameterInParams(array $options, array $params, mixed $parameter) : array

    Helper function that validates and includes an old single method parameter setting into the parameters array given.

    This is only for keeping backwards-compatibility where methods had for example a parameter which was called 'policy' and which was later changed to being an array of options, so more than one options can be passed easily. This is only for options that are to be sent to the ArangoDB server.

    Parameters

    array $options
    • The options array that may hold the policy to include in the parameters. If it's not an array, then the value is the policy value.
    array $params
    • The parameters into which the options will be included.
    mixed $parameter
    • the old single parameter key to use.

    Returns

    array —

    $params - array of parameters for use in a url

    includeOptionsInParams()

    includeOptionsInParams(array $options, array $params, array $includeArray) : array

    Helper function that runs through the options given and includes them into the parameters array given.

    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 form of url parameters (like 'waitForSync', 'keepNull', etc...) .

    Parameters

    array $options
    • The options array that holds the options to include in the parameters
    array $params
    • The parameters into which the options will be included.
    array $includeArray
    • The array that defines which options are allowed to be included, and what their default value is. for example: 'waitForSync'=>true

    Returns

    array —

    $params - array of parameters for use in a url

    includeOptionsInBody()

    includeOptionsInBody(array $options, array $body, array $includeArray) : array

    Helper function that runs through the options given and includes them into the parameters array given.

    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...) .

    Parameters

    array $options
    • The options array that holds the options to include in the parameters
    array $body
    • The array into which the options will be included.
    array $includeArray
    • The array that defines which options are allowed to be included, and what their default value is. for example: 'waitForSync'=>true

    Returns

    array —

    $params - array of parameters for use in a url