Oihana PHP Arango

extractNestedRelations.php

Table of Contents

Functions

extractNestedRelations()  : array{edges: array, joins: array}
Extract nested edges and joins from a relation configuration or resolved model.

Functions

extractNestedRelations()

Extract nested edges and joins from a relation configuration or resolved model.

extractNestedRelations(array<string|int, mixed> $config[, object|null $targetModel = null ][, bool|null $isEdge = null ][, ContainerInterface|null $container = null ]) : array{edges: array, joins: array}

This function can work in two modes:

  1. Resolution mode: Resolves target model from config via container, then extracts relations
  2. Direct mode: Extracts relations from an already-resolved target model

In both modes, the function merges the extracted relations with any explicit AQL::EDGES and AQL::JOINS defined in the relation configuration.

Resolution mode (for parseFilterSegment):

$relations = extractNestedRelations(
    config: $edgeConfig,
    isEdge: true,
    container: $container
);

Direct mode (for buildEdgeTraversal/buildJoinTraversal):

$relations = extractNestedRelations(
    config: $edgeConfig,
    targetModel: $alreadyResolvedModel
);
Parameters
$config : array<string|int, mixed>

The relation configuration (edge or join config).

$targetModel : object|null = null

Optional: already-resolved target model.

$isEdge : bool|null = null

Required if $targetModel is null: true for edges, false for joins.

$container : ContainerInterface|null = null

Required if $targetModel is null: DI container.

Tags
throws
ContainerExceptionInterface
NotFoundExceptionInterface
Return values
array{edges: array, joins: array}

Associative array with 'edges' and 'joins' keys.

On this page

Search results