Oihana PHP Arango

updateRelations.php

Table of Contents

Functions

updateRelations()  : void
Updates one or several relations for a given document.

Functions

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