Oihana PHP Arango

trustedAlt.php

Table of Contents

Functions

trustedAlt()  : AltChain
Signs an `alt` chain as authored by the consumer's own code, so its parameters are interpolated as written rather than bound.

Functions

trustedAlt()

Signs an `alt` chain as authored by the consumer's own code, so its parameters are interpolated as written rather than bound.

trustedAlt(mixed $chain) : AltChain

Only needed where a chain reaches the engine through a request slot — today $init[FilterParam::ALT], which a host may also fill programmatically through InjectFilterTrait::injectFilter(). Everything read from a model declaration (Field::ALTERS, Facet::ALT) is trusted by default and needs no signature.

Sign a chain only when it must name an expression the request could not supply — another attribute, typically. A chain carrying plain values needs nothing: bound is what you want.

Parameters
$chain : mixed

The chain, in any of the alt notations.

Tags
example
use function oihana\arango\db\helpers\trustedAlt;

// Compare a field to another field — impossible from a request, on purpose.
$this->injectFilter( $init , 'name' , $v , alt: trustedAlt( [ 'like' , 'doc.pattern' ] ) ) ;
since
1.6.0
author

Marc Alcaraz

Return values
AltChain —

The signed chain.

On this page

Search results