Oihana PHP Arango

aqlUpdateExpression.php

Table of Contents

Functions

aqlUpdateExpression()  : string
Builds the `UPDATE` clause of an AQL operation.

Functions

aqlUpdateExpression()

Builds the `UPDATE` clause of an AQL operation.

aqlUpdateExpression([array<string|int, mixed> $init = [] ]) : string

Renders the document/expression supplied under the AQL::UPDATE key as UPDATE <expression> (the expression goes through aqlExpression(), so it accepts an object literal, a [key, value] pair list, or a raw string). The AQL::UPDATE key is required: an init that omits it throws an InvalidArgumentException.

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

Associative array with:

  • AQL::UPDATE : array|string — the update expression (required).
Tags
throws
InvalidArgumentException

If the AQL::UPDATE option is missing.

UnsupportedOperationException
example

Object literal update:

use oihana\arango\db\enums\AQL;
use function oihana\arango\db\helpers\aqlUpdateExpression;

echo aqlUpdateExpression([ AQL::UPDATE => [ [ 'foo' , 'bar' ] ] ]);
// UPDATE {foo:'bar'}

Invalid — UPDATE key missing:

aqlUpdateExpression([]);
// InvalidArgumentException: UPDATE option is required
since
1.0.0
author

Marc Alcaraz

Return values
string

The UPDATE … clause.

On this page

Search results