authorizationChecker = $authorizationChecker; $this->translator = $translator; } public function buildMenu($menuId, MenuItem $menu, array $parameters) { /* @var $person \Chill\PersonBundle\Entity\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' ]; } }