getAllAliases(), true)) { $qb->leftJoin('activity.users', 'actusers'); } $qb ->addSelect('IDENTITY(actusers.mainScope) AS activity_users_main_scope_aggregator') ->addGroupBy('activity_users_main_scope_aggregator'); } public function applyOn() { return Declarations::ACTIVITY; } public function buildForm(FormBuilderInterface $builder) { // nothing to add in the form } public function getLabels($key, array $values, $data) { return function ($value): string { if ('_header' === $value) { return 'Users \'s scope'; } if (null === $value || '' === $value) { return ''; } $s = $this->scopeRepository->find($value); return $this->translatableStringHelper->localize( $s->getName() ); }; } public function getQueryKeys($data): array { return ['activity_users_main_scope_aggregator']; } public function getTitle() { return 'Aggregate by users scope'; } }