$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()));
} $nested =
$this->
parseAggregation($aggregation->
getAggregation(),
$definition,
$context);
if ($nested === null
) { throw new \
RuntimeException(sprintf('Nested filter aggregation %s can not be parsed.',
$aggregation->
getName()));
} // when aggregation inside the filter aggregation points to a nested object (e.g. product.properties.id) we have to add all filters
// which points to the same association to the same "nesting" level like the nested aggregation for this association
$path =
$nested instanceof NestedAggregation ?
$nested->
getPath() : null;