public function applyOnEntity(Entity $entity) { $groups = $this->getAppliedGroups(); foreach ($groups as $group) { if (($group['type'] ?? null) == 'db') { $entity->groupBy($group['field']); } } }