\triagens\ArangoDbTraversal

Provides graph traversal

A Traversal object is used to execute a graph traversal on the server side.

The object requires the connection object, the startVertex, the edgeCollection and the optional parameters.

Summary

Methods
Properties
Constants
__construct()
getResult()
setStartVertex()
getStartVertex()
setEdgeCollection()
getEdgeCollection()
set()
__set()
get()
__get()
__toString()
No public properties found
OPTION_FIELDS
ENTRY_STARTVERTEX
ENTRY_EDGECOLLECTION
getConnection()
$attributes
N/A
No private methods found
$_connection
N/A

Constants

OPTION_FIELDS

OPTION_FIELDS

count fields

ENTRY_STARTVERTEX

ENTRY_STARTVERTEX

Collections index

ENTRY_EDGECOLLECTION

ENTRY_EDGECOLLECTION

Action index

Properties

$attributes

$attributes : array

The traversal's attributes.

Type

array

Methods

__construct()

__construct(\triagens\ArangoDb\Connection $connection, string $startVertex, string $edgeCollection, array $options) : \triagens\ArangoDb\Traversal

Initialise the Traversal object

Parameters

\triagens\ArangoDb\Connection $connection
  • the connection to be used
string $startVertex
  • user function initialization data
string $edgeCollection
  • user function initialization data
array $options

Returns

\triagens\ArangoDb\Traversal

getResult()

getResult() : array

Execute and get the traversal result

Returns

array —

$responseArray

setStartVertex()

setStartVertex(string $value)

Set name of the user function. It must have at least one namespace, but also can have sub-namespaces.

correct: 'myNamespace:myFunction' 'myRootNamespace:mySubNamespace:myFunction'

wrong: 'myFunction'

Parameters

string $value

getStartVertex()

getStartVertex() : string

Get name value

Returns

string —

name

setEdgeCollection()

setEdgeCollection(string $value)

Set user function code

Parameters

string $value

getEdgeCollection()

getEdgeCollection() : string

Get user function code

Returns

string —

name

set()

set( $key,  $value)

Set an attribute

Parameters

$key
$value

Throws

\triagens\ArangoDb\ClientException

__set()

__set(string $key, mixed $value) : void

Set an attribute, magic method

This is a magic method that allows the object to be used without declaring all attributes first.

Parameters

string $key
  • attribute name
mixed $value
  • value for attribute

Throws

\triagens\ArangoDb\ClientException

get()

get(string $key) : mixed

Get an attribute

Parameters

string $key
  • name of attribute

Returns

mixed —
  • value of attribute, NULL if attribute is not set

__get()

__get(string $key) : mixed

Get an attribute, magic method

This function is mapped to get() internally.

Parameters

string $key
  • name of attribute

Returns

mixed —
  • value of attribute, NULL if attribute is not set

__toString()

__toString() : string

Returns the action string

Returns

string —
  • the current action string

getConnection()

getConnection() : \triagens\ArangoDb\Connection

Return the connection object

Returns

\triagens\ArangoDb\Connection
  • the connection object