isPolymorphic.php
Table of Contents
Functions
- isPolymorphic() : bool
- Tells whether a relation definition — a **join** or an **edge** — is *polymorphic*, i.e. its target collection is chosen at query time from a discriminator field of the parent document / start vertex.
Functions
isPolymorphic()
Tells whether a relation definition — a **join** or an **edge** — is *polymorphic*, i.e. its target collection is chosen at query time from a discriminator field of the parent document / start vertex.
isPolymorphic(mixed $definition) : bool
A polymorphic relation replaces the single AQL::MODEL by:
Arango::DISCRIMINATOR— the parent field path deciding the branch (e.g.selector.areaScopefor a join,kindfor an edge) ;Arango::MAP— a non-emptytype => relation-definitiontable, one branch per discriminator value (each branch is itself a regular relation definition) ;Arango::FALLBACK(optional) — the branch used when the discriminator value matches noArango::MAPkey.
Parameters
- $definition : mixed
-
The resolved relation definition (usually an array).
Tags
Return values
bool —true when the definition carries a non-empty Arango::MAP
and a non-empty string Arango::DISCRIMINATOR, false otherwise.