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
Constructs an new edge definition
__construct(string $relation = null
, array|string $fromCollections = array()
, array|string $toCollections = array()
)
Parameters
$relation
string
- name of the relation (the underlying edge collection).
$fromCollections
array
string
- a list of collections providing the edges start vertices or a string holding a single collection name.
$toCollections
array
string
- a list of collections providing the edges end vertices or a string holding a single collection name.
Add a 'from' collections of the graph.
addFromCollection(string $fromCollection)
Parameters
$fromCollection
string
- the name of the added collection.
Add a 'to' collections of the graph.
addToCollection(string $toCollection)
Parameters
$toCollection
string
- the name of the added collection.
Resets the 'from' collections of the graph.
clearFromCollection()
Resets the 'to' collections of the graph.
clearToCollection()
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'.
createDirectedRelation(string $relation, array|string $fromCollections, array|string $toCollections) : \ArangoDBClient\EdgeDefinition
Static
Parameters
$relation
string
- name of the relation (the underlying edge collection).
$fromCollections
array
string
- a list of collections providing the edges start vertices or a string holding a single collection name.
$toCollections
array
string
- a list of collections providing the edges end vertices or a string holding a single collection name.
Returns
\ArangoDBClient\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.
createUndirectedRelation(string $relation, array $vertexCollections) : \ArangoDBClient\EdgeDefinition
Static
Parameters
$relation
string
- name of the relation (the underlying edge collection).
$vertexCollections
array
- a list of collections providing the edges start and end vertices.
Returns
\ArangoDBClient\EdgeDefinition
Get the 'from' collections of the graph.
getFromCollections() : array
Get the relation of the edge definition.
getRelation() : string
Get the 'to' collections of the graph.
getToCollections() : array
Set the relation of the edge definition
setRelation(string $relation)
Parameters
$relation
string
- the name of the relation.
Properties
An array containing the names of the vertices collections holding the start vertices.
$_fromCollections : array
The name of the edge collection for this relation.
$_relation : string
An array containing the names of the vertices collections holding the end vertices.
$_toCollections : array