return $nested;
} public function parseFilter(Filter
$filter, EntityDefinition
$definition, string
$root, Context
$context): BuilderInterface
{ return match (true
) { $filter instanceof NotFilter =>
$this->
parseNotFilter($filter,
$definition,
$root,
$context),
$filter instanceof MultiFilter =>
$this->
parseMultiFilter($filter,
$definition,
$root,
$context),
$filter instanceof EqualsFilter =>
$this->
parseEqualsFilter($filter,
$definition,
$context),
$filter instanceof EqualsAnyFilter =>
$this->
parseEqualsAnyFilter($filter,
$definition,
$context),
$filter instanceof ContainsFilter =>
$this->
parseContainsFilter($filter,
$definition,
$context),
$filter instanceof PrefixFilter =>
$this->
parsePrefixFilter($filter,
$definition,
$context),
$filter instanceof SuffixFilter =>
$this->
parseSuffixFilter($filter,
$definition,
$context),
$filter instanceof RangeFilter =>
$this->
parseRangeFilter($filter,
$definition,
$context),
default =>
throw new \
RuntimeException(sprintf('Unsupported filter %s',
$filter::
class)),
};
} protected function parseFilterAggregation(FilterAggregation
$aggregation, EntityDefinition
$definition, Context
$context): AbstractAggregation
{ if ($aggregation->
getAggregation() === null
) { throw new \
RuntimeException(sprintf('Filter aggregation %s contains no nested aggregation.',
$aggregation->
getName()));
}