authorizationChecker = $authorizationChecker; $this->translator = $translator; } public function buildMenu($menuId, MenuItem $menu, array $parameters) { /** @var \Chill\PersonBundle\Entity\Person $person */ $person = $parameters['person'] ?? null; if ($this->authorizationChecker->isGranted(EventVoter::SEE, $person)) { $menu->addChild($this->translator->trans('Events participation'), [ 'route' => 'chill_event__list_by_person', 'routeParameters' => [ 'person_id' => $person->getId(), ], ]) ->setExtras([ 'order' => 500, ]); } } public static function getMenuIds(): array { return ['person']; } }