Aggregation
$aggregation = null,
private readonly ?string
$format = null,
private readonly ?string
$timeZone = null
) { parent::
__construct($name,
$field,
$aggregation);
$interval =
mb_strtolower($interval);
if (!\
in_array($interval,
[self::PER_MINUTE, self::PER_HOUR, self::PER_DAY, self::PER_WEEK, self::PER_MONTH, self::PER_QUARTER, self::PER_YEAR
], true
)) { throw new \
RuntimeException('Provided date histogram interval is not supported'
);
} if (\
is_string($timeZone) && !\
in_array($timeZone, \DateTimeZone::
listIdentifiers(\DateTimeZone::ALL_WITH_BC
), true
)) { throw new \
InvalidArgumentException(\
sprintf('Given "%s" is not a valid timezone',
$timeZone));
} $this->interval =
$interval;
} public function getFormat(): ?string
{ return $this->format;
}