Oihana PHP Arango

isProperty.php

Table of Contents

Functions

isProperty()  : array<string|int, mixed>
Build an AQL equality condition on a document property.

Functions

isProperty()

Build an AQL equality condition on a document property.

isProperty(string $property, null|string|array<string|int, mixed> $value[, string $docRef = AQL::DOC ]) : array<string|int, mixed>

This helper creates an equality condition (==) when a scalar value or AQL expression is provided, and an IN condition when an array of values is given.

Parameters
$property : string

The property name (Prop::*)

$value : null|string|array<string|int, mixed>

The expected value or expression.

$docRef : string = AQL::DOC

The AQL doc reference (default: doc)

Tags
example
isProperty('status', 'active');
// → doc.status == 'active'

isProperty('status', ['active', 'pending']);
// → doc.status IN ['active','pending']

isProperty('tags', '@tags');
// → doc.tags == @tags

isProperty('name', 'doc2.name');
// → doc.name == doc2.name

isProperty('table', [1, 'hello', true, '\@_param']);
// → doc.table IN [1,'hello',true,@param]
throws
InvalidArgumentException

If the value is null, empty, or invalid

UnsupportedOperationException

If the value type is unsupported.

author

Marc Alcaraz (eKameleon)

version
1.5.0
Return values
array<string|int, mixed>

An array containing a single AQL condition expression

On this page

Search results