Oihana PHP Arango

relations

Table of Contents

Functions

updateEdgeRelation()  : void
Handles the update of a single EDGE-type relation.
updateRelations()  : void
Updates one or several relations for a given document.

Functions

updateEdgeRelation()

Handles the update of a single EDGE-type relation.

updateEdgeRelation(string $name, array<string|int, mixed> $options, array<string|int, mixed>|object|null $document[, ContainerInterface|null $container = null ][, Documents|null $documents = null ]) : void
Parameters
$name : string

The relation property name.

$options : array<string|int, mixed>

The relation definition options.

$document : array<string|int, mixed>|object|null

The current document instance.

$container : ContainerInterface|null = null

Optional PSR-11 container used to resolve the Edges definitions

$documents : Documents|null = null

Optional Documents reference to find the Edges definitions.

Tags
throws
ArangoException
BindException
ContainerExceptionInterface
DateInvalidTimeZoneException
DateMalformedStringException
DependencyException
Error409
NotFoundException
NotFoundExceptionInterface
ReflectionException
UnsupportedOperationException
Throwable

updateRelations()

Updates one or several relations for a given document.

updateRelations([array<string|int, mixed>|object|null $document = null ][, array<string|int, mixed>|null $relations = [] ][, Documents|null $documents = null ][, ContainerInterface|null $container = null ]) : void
  • For the moment the only relations of type AQLType::EDGE are currently supported.
  • Each relation can define its model, direction, key, and target value.
  • If the provided relation does not define a valid Edges model, the method will attempt to resolve it from the parent Documents model.

Example:

updateRelations( $document ,
[
    'contains' =>
    [
        Arango::TYPE      => AQLType::EDGE,
        Arango::MODEL     => 'place_edges',
        Arango::DIRECTION => Traversal::OUTBOUND,
        Arango::KEY       => Schema::_KEY,
        Arango::VALUE     => 'place/12345',
    ],
] , $container  , $documents ) ;
Parameters
$document : array<string|int, mixed>|object|null = null

The document whose relations should be updated.

$relations : array<string|int, mixed>|null = []

The associative array of relation definitions.

$documents : Documents|null = null

Optional Documents reference to find the Edges definitions.

$container : ContainerInterface|null = null

Optional PSR-11 container used to resolve the Edges definitions

Tags
throws
ArangoException
BindException
ContainerExceptionInterface
DateInvalidTimeZoneException
DateMalformedStringException
DependencyException
Error409
NotFoundException
NotFoundExceptionInterface
ReflectionException
Throwable
UnsupportedOperationException
On this page

Search results