Menu

## Traversal
in package

Traversal.php : 22

Represents a graph traversal.

##### Tags

author

  Lucas S. Vieira

### Table of Contents

#### Constants

GRAPH_DIRECTION_ANY = 'ANY'
  Any graph direction.
GRAPH_DIRECTION_INBOUND = 'INBOUND'
  Inbound graph direction.
GRAPH_DIRECTION_OUTBOUND = 'OUTBOUND'
  Outbound graph direction.

#### Methods

__construct() : mixed
  Traversal constructor.
setConnection() : void
  Sets a connection to use for traversal.
toAql() : string
  Returns the query,
traversalQuery() : Traversal
  Returns a default traversal

### Constants

#### GRAPH_DIRECTION_ANY

Traversal.php : 43

Any graph direction.

`public string GRAPH_DIRECTION_ANY = 'ANY'`

#### GRAPH_DIRECTION_INBOUND

Traversal.php : 29

Inbound graph direction.

`public string GRAPH_DIRECTION_INBOUND = 'INBOUND'`

#### GRAPH_DIRECTION_OUTBOUND

Traversal.php : 36

Outbound graph direction.

`public string GRAPH_DIRECTION_OUTBOUND = 'OUTBOUND'`

### Methods

#### __construct()

Traversal.php : 74

Traversal constructor.

`public __construct(Statement $statement[, Connection|null $connection = null ]) : mixed`

##### Parameters

$statement : Statement

  AQL Statement for traversal.

$connection : Connection|null = null

  The connection object to use.

##### Tags

throws
  CursorException|GuzzleException

#### setConnection()

Traversal.php : 89

Sets a connection to use for traversal.

`public setConnection(Connection $connection) : void`

##### Parameters

$connection : Connection

#### toAql()

Traversal.php : 101

Returns the query,

`public toAql() : string`

##### Tags

throws
  StatementException

##### Return values

string

#### traversalQuery()

Traversal.php : 118

Returns a default traversal

`public static traversalQuery(Vertex $vertex, string $graph[, string $direction = self::GRAPH_DIRECTION_ANY ][, int $depth = 0 ]) : Traversal`

##### Parameters

$vertex : Vertex

  Vertex to start graph traversal.

$graph : string

  The graph to traverse.

$direction : string = self::GRAPH_DIRECTION_ANY

  Direction for traversal.

$depth : int = 0

  Visits only nodes in at least the given depth.

##### Tags

throws
  CursorException|GuzzleException|Exception

##### Return values

Traversal —

Traversal object.

## Search results