addSelect('activity.sentReceived AS activity_sentreceived_aggregator') ->addGroupBy('activity_sentreceived_aggregator'); } public function applyOn(): string { return Declarations::ACTIVITY; } public function buildForm(FormBuilderInterface $builder) { // No form needed } public function getLabels($key, array $values, $data) { return static function ($value): string { if ('_header' === $value) { return ''; } switch ($value) { case 'sent': return 'is sent'; case 'received': return 'is received'; default: throw new LogicException(sprintf('The value %s is not valid', $value)); } }; } public function getQueryKeys($data): array { return ['activity_sentreceived_aggregator']; } public function getTitle(): string { return 'Group activity by sentreceived'; } }