getAllAliases(), true)) { $qb->join('cal.cancelReason', 'calcancel'); } $qb->addSelect('IDENTITY(cal.cancelReason) as cancel_reason_aggregator'); $qb->addGroupBy('cancel_reason_aggregator'); } public function applyOn(): string { return Declarations::CALENDAR_TYPE; } public function buildForm(FormBuilderInterface $builder) { // no form } public function getFormDefaultData(): array { return []; } public function getLabels($key, array $values, $data): \Closure { return function ($value): string { if ('_header' === $value) { return 'Cancel reason'; } if (null === $value || '' === $value) { return ''; } $j = $this->cancelReasonRepository->find($value); return $this->translatableStringHelper->localize( $j->getName() ); }; } public function getQueryKeys($data): array { return ['cancel_reason_aggregator']; } public function getTitle(): string { return 'Group calendars by cancel reason'; } }