HasFacetIn
Builds the AQL filter fragment for an {@see Facet::IN} facet: array membership between the requested values and a document array property `doc.<property>`, driven by an operator (`op`) that reuses the filter vocabulary ({@see FilterArrayComparator}: `any.in` default, `all.in`, `none.in`, …).
This is the single primitive of the "field"-family list facets: HasFacetListField (LIST_FIELD / LIST_FIELD_SORTED) and HasFacetList (LIST) delegate here. Composed via FacetTrait.
Operand orientation is TO_ARRAY([@v0,@v1,...]) <op> doc.<property> (the
requested values on the left), so all.in reads as "the document has ALL the
requested values" — the natural multi-select semantics, and intentionally the
mirror of the ?filter= ARRAY orientation (doc.field <op> [values]).
Tags
Table of Contents
Methods
- prepareFacetIn() : string
- Prepares an array membership facet.
Methods
prepareFacetIn()
Prepares an array membership facet.
protected
prepareFacetIn(string $key, mixed $value, array<string|int, mixed> &$binds, array<string|int, mixed> $facet, string $doc[, bool $sortable = false ]) : string
Parameters
- $key : string
-
The facet key (also the default document array property).
- $value : mixed
-
Either a CSV string (
"a,b"), a list (["a","b"]) or an{op, val}object selecting the operator per request. - $binds : array<string|int, mixed>
-
The bind variables, populated by reference.
- $facet : array<string|int, mixed>
-
The facet definition (
Facet::PROPERTY,Facet::OP). - $doc : string
-
The document reference the array is read from.
- $sortable : bool = false
-
When true, append
SORT POSITION(...)to order by the requested values.