Oihana PHP Arango

HasFilterConditions

This trait defines the conditions filter helpers. We can combine filters with logical operators.

Tags
example
?filter=[ condition1 , condition2 ] // (condition1 && condition2)
?filter=[ "and" , condition1 , condition2 ] // (condition1 && condition2)
?filter=[ "or"  , condition1 , condition2 ] // (condition1 || condition2)
?filter=[ "and" , ["or",condition1,condition2],["or",condition3,condition4]] // ( (condition1 || condition2) && (condition3 || condition4) )
?filter=[ "not" , condition] // !(condition)

Table of Contents

Methods

prepareFilterConditions()  : string|null
Prepares the filter clause of a group : a list of conditions, led by its operator (`and` when it has none).

Methods

prepareFilterConditions()

Prepares the filter clause of a group : a list of conditions, led by its operator (`and` when it has none).

public prepareFilterConditions([array<string|int, mixed> $init = [] ][, array<string|int, mixed>|null &$binds = null ][, string $docRef = AQL::DOC ][, array<string|int, mixed> $auth = [] ]) : string|null

A group that cannot be read is REFUSED : an operator nothing knows (xor), a group with no condition (["or"]), a not of several conditions — which used to compile (a ! b), AQL the server refuses. Every member is compiled by FilterTrait::compileFilter(), which refuses a member it cannot read instead of dropping it : dropped, it loosened an and.

Parameters
$init : array<string|int, mixed> = []

The group.

$binds : array<string|int, mixed>|null = null

The bind variables, populated by reference.

$docRef : string = AQL::DOC

The document reference the conditions are written against.

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

The request-level authorizer, passed down to every member.

Tags
throws
BindException
ConstantException
ContainerExceptionInterface
DependencyException
NotFoundException
NotFoundExceptionInterface
ReflectionException
RequestValidationException

When the group, or one of its members, cannot be read.

UnsupportedOperationException
ValidationException
Return values
string|null —

The AQL condition, or null when no member constrains anything.

On this page

Search results