aqlPrune.php
Table of Contents
Functions
- aqlPrune() : string|null
- Builds an AQL `PRUNE` clause from one or more logical conditions.
Functions
aqlPrune()
Builds an AQL `PRUNE` clause from one or more logical conditions.
aqlPrune([string|array<string|int, mixed>|null $conditions = null ][, string $logicalOperator = Logic::AND ]) : string|null
The PRUNE operation is used in graph traversals to stop traversing along the current path if the condition is met.
Syntax:
PRUNE expression
The expression must evaluate to either true or false.
Example:
use function oihana\arango\db\operations\aqlPrune;
echo aqlPrune( 'v.age > 40' ) . PHP_EOL;
// PRUNE v.age > 40
echo aqlPrune( [ 'e.type == "friend"', 'v.status == "inactive"' ], '||' ) . PHP_EOL;
// PRUNE e.type == "friend" || v.status == "inactive"
echo aqlPrune(); // null
Parameters
- $conditions : string|array<string|int, mixed>|null = null
-
The expression(s) to evaluate in the FILTER operation.
- $logicalOperator : string = Logic::AND
-
The logical operator used to join conditions if
$conditionsis an array (default&&).
Tags
Return values
string|null —The compiled AQL PRUNE clause, or null if no valid condition was provided.