Class EdgeDefinition
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'.
Methods summary
public
|
#
__construct( string $relation = null, array|string $fromCollections = [], array|string $toCollections = [] )
Constructs an new edge definition
Constructs an new edge definition
Parameters
- $relation
- name of the relation (the underlying edge collection).
- $fromCollections
- a list of collections providing the edges start vertices or a string holding a single collection name.
- $toCollections
- a list of collections providing the edges end vertices or a string holding a single collection name.
Since
2.2
|
public
|
#
setRelation( string $relation )
Set the relation of the edge definition
Set the relation of the edge definition
Parameters
- $relation
- the name of the relation.
Since
2.2
|
public
string
|
#
getRelation( )
Get the relation of the edge definition.
Get the relation of the edge definition.
Returns
string
Since
2.2
|
public
array
|
#
getToCollections( )
Get the 'to' collections of the graph.
Get the 'to' collections of the graph.
Returns
array
Since
2.2
|
public
array
|
#
getFromCollections( )
Get the 'from' collections of the graph.
Get the 'from' collections of the graph.
Returns
array
Since
2.2
|
public
|
#
addToCollection( string $toCollection )
Add a 'to' collections of the graph.
Add a 'to' collections of the graph.
Parameters
- $toCollection
- the name of the added collection.
Since
2.2
|
public
|
#
addFromCollection( string $fromCollection )
Add a 'from' collections of the graph.
Add a 'from' collections of the graph.
Parameters
- $fromCollection
- the name of the added collection.
Since
2.2
|
public
|
#
clearToCollection( )
Resets the 'to' collections of the graph.
Resets the 'to' collections of the graph.
Since
2.2
|
public
|
#
clearFromCollection( )
Resets the 'from' collections of the graph.
Resets the 'from' collections of the graph.
Since
2.2
|
public
array
|
#
transformToArray( )
Transforms an edge definition to an array.
Transforms an edge definition to an array.
Returns
array
Since
2.2
|
public static
triagens\ArangoDb\EdgeDefinition
|
#
createUndirectedRelation( string $relation, array $vertexCollections )
Constructs an undirected relation. This relation is an edge definition where the edges can start and end
in any vertex from the collection list.
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
- $relation
- name of the relation (the underlying edge collection).
- $vertexCollections
- a list of collections providing the edges start and end vertices.
Returns
Since
2.2
|
public static
triagens\ArangoDb\EdgeDefinition
|
#
createDirectedRelation( string $relation, array|string $fromCollections, array|string $toCollections )
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'.
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
- $relation
- name of the relation (the underlying edge collection).
- $fromCollections
- a list of collections providing the edges start vertices or a string holding a single collection name.
- $toCollections
- a list of collections providing the edges end vertices or a string holding a single collection name.
Returns
Since
2.2
|
Properties summary
protected
string
|
$_relation
The name of the edge collection for this relation.
The name of the edge collection for this relation.
|
|
protected
array
|
$_fromCollections
An array containing the names of the vertices collections holding the start vertices.
An array containing the names of the vertices collections holding the start vertices.
|
|
protected
array
|
$_toCollections
An array containing the names of the vertices collections holding the end vertices.
An array containing the names of the vertices collections holding the end vertices.
|
|