\
assert($aggregationStruct !== null, 'FilterAggregation always have an aggregation'
);
$this->
extendQuery($aggregationStruct,
$query,
$definition,
$context);
} private function parseDateHistogramAggregation( DateHistogramAggregation
$aggregation,
QueryBuilder
$query,
EntityDefinition
$definition,
Context
$context ): void
{ $accessor =
$this->queryHelper->
getFieldAccessor($aggregation->
getField(),
$definition,
$definition->
getEntityName(),
$context);
if ($this->timeZoneSupportEnabled &&
$aggregation->
getTimeZone()) { $accessor = 'CONVERT_TZ(' .
$accessor . ', "UTC", "' .
$aggregation->
getTimeZone() . '")';
} $groupBy =
match ($aggregation->
getInterval()) { DateHistogramAggregation::PER_MINUTE => 'DATE_FORMAT(' .
$accessor . ', \'%Y-%m-%d %H:%i\')',
DateHistogramAggregation::PER_HOUR => 'DATE_FORMAT(' .
$accessor . ', \'%Y-%m-%d %H\')',
DateHistogramAggregation::PER_DAY => 'DATE_FORMAT(' .
$accessor . ', \'%Y-%m-%d\')',
DateHistogramAggregation::PER_WEEK => 'DATE_FORMAT(' .
$accessor . ', \'%Y-%v\')',
DateHistogramAggregation::PER_MONTH => 'DATE_FORMAT(' .
$accessor . ', \'%Y-%m\')',