\triagens\ArangoDbEdgeDefinition

Value object representing an edge Definition.

An edge definition contains a collection called 'relation' to store the edges and multiple vertices collection defined in 'fromCollections' and 'toCollections'.


Summary

Methods
Properties
Constants
__construct()
setRelation()
getRelation()
getToCollections()
getFromCollections()
addToCollection()
addFromCollection()
clearToCollection()
clearFromCollection()
transformToArray()
createUndirectedRelation()
createDirectedRelation()
No public properties found
No constants found
No protected methods found
$_relation
$_fromCollections
$_toCollections
N/A
No private methods found
No private properties found
N/A

Properties

$_relation

$_relation : string

The name of the edge collection for this relation.

Type

string — name of the edge collectio

$_fromCollections

$_fromCollections : array

An array containing the names of the vertices collections holding the start vertices.

Type

array — names of the start vertices collection

$_toCollections

$_toCollections : array

An array containing the names of the vertices collections holding the end vertices.

Type

array — names of the end vertices collection

Methods

__construct()

__construct(string $relation, array $fromCollections, array $toCollections) : \triagens\ArangoDb\EdgeDefinition

Constructs an new edge definition

Parameters

string $relation
  • name of the relation (the underlying edge collection).
array $fromCollections
  • a list of collections providing the edges start vertices.
array $toCollections
  • a list of collections providing the edges end vertices.

Returns

\triagens\ArangoDb\EdgeDefinition

setRelation()

setRelation(string $relation)

Set the relation of the edge definition

Parameters

string $relation
  • the name of the relation.

getRelation()

getRelation() : string

Get the relation of the edge definition.

Returns

string

getToCollections()

getToCollections() : array

Get the 'to' collections of the graph.

Returns

array

getFromCollections()

getFromCollections() : array

Get the 'from' collections of the graph.

Returns

array

addToCollection()

addToCollection(string $toCollection)

Add a 'to' collections of the graph.

Parameters

string $toCollection
  • the name of the added collection.

addFromCollection()

addFromCollection(string $fromCollection)

Add a 'from' collections of the graph.

Parameters

string $fromCollection
  • the name of the added collection.

clearToCollection()

clearToCollection()

Resets the 'to' collections of the graph.

clearFromCollection()

clearFromCollection()

Resets the 'from' collections of the graph.

transformToArray()

transformToArray() : array

Transforms an edge definition to an array.

Returns

array

createUndirectedRelation()

createUndirectedRelation(string $relation, array $vertexCollections) : \triagens\ArangoDb\EdgeDefinition

Constructs an undirected relation. This relation is an edge definition where the edges can start and end in any vertex from the collection list.

Parameters

string $relation
  • name of the relation (the underlying edge collection).
array $vertexCollections
  • a list of collections providing the edges start and end vertices.

Returns

\triagens\ArangoDb\EdgeDefinition

createDirectedRelation()

createDirectedRelation(string $relation, array $fromCollections, array $toCollections) : \triagens\ArangoDb\EdgeDefinition

Constructs a directed relation. This relation is an edge definition where the edges can start only in the vertices defined in 'fromCollections' and end in vertices defined in 'toCollections'.

Parameters

string $relation
  • name of the relation (the underlying edge collection).
array $fromCollections
  • a list of collections providing the edges start vertices.
array $toCollections
  • a list of collections providing the edges end vertices.

Returns

\triagens\ArangoDb\EdgeDefinition