groupBuckets example

DateHistogramAggregation $aggregation,
        EntityDefinition $definition,
        array $rows,
        Context $context
    ): DateHistogramResult {
        if (empty($rows)) {
            return new DateHistogramResult($aggregation->getName()[]);
        }

        $buckets = [];

        $grouped = $this->groupBuckets($aggregation$rows);

        foreach ($grouped as $value => $group) {
            $count = $group['count'];
            $nested = null;

            if ($aggregation->getAggregation()) {
                $nested = $this->hydrateResult($aggregation->getAggregation()$definition$group['buckets']$context);
            }

            $date = new \DateTime($value);

            
Home | Imprint | This part of the site doesn't use cookies.