public function addScheduleItem(ProductionMenuCollectionEvent $event): void
    {
        $menu = $event->getMenu();
        $group = $event->getGroup();

        // Create overview menu item.
        $schedule = $this->factory->createItem('menu_item.schedule', [
            'route' => 'bkstg_calendar_production',
            'routeParameters' => ['production_slug' => $group->getSlug()],
            'extras' => [
                'icon' => 'calendar',
                'translation_domain' => BkstgScheduleBundle::TRANSLATION_DOMAIN,
            ],
        ]);
        $menu->addChild($schedule);

        // If this user is an editor create the calendar and archive items.
        if ($this->auth->isGranted('GROUP_ROLE_EDITOR', $group)) {
            $calendar = $this->factory->createItem('menu_item.schedule_calendar', [
                'route' => 'bkstg_calendar_production',
                'routeParameters' => ['production_slug' => $group->getSlug()],
                'extras' => ['translation_domain' => BkstgScheduleBundle::TRANSLATION_DOMAIN],
            ]);
            $schedule->addChild($calendar);

            $archive = $this->factory->createItem('menu_item.schedule_archive', [
                'route' => 'bkstg_schedule_archive',
                'routeParameters' => ['production_slug' => $group->getSlug()],
                'extras' => ['translation_domain' => BkstgScheduleBundle::TRANSLATION_DOMAIN],
            ]);
            $schedule->addChild($archive);
        }
    }
public function addScheduleItem(ProductionMenuCollectionEvent $event): void
    {
        $menu = $event->getMenu();
        $group = $event->getGroup();

        // Create overview menu item.
        $schedule = $this->factory->createItem('menu_item.schedule', [
            'route' => 'bkstg_calendar_production',
            'routeParameters' => ['production_slug' => $group->getSlug()],
            'extras' => [
                'icon' => 'calendar',
                'translation_domain' => BkstgScheduleBundle::TRANSLATION_DOMAIN,
            ],
        ]);
        $menu->addChild($schedule);

        // If this user is an editor create the calendar and archive items.
        if ($this->auth->isGranted('GROUP_ROLE_EDITOR', $group)) {
            $calendar = $this->factory->createItem('menu_item.schedule_calendar', [
                'route' => 'bkstg_calendar_production',
                'routeParameters' => ['production_slug' => $group->getSlug()],
                'extras' => ['translation_domain' => BkstgScheduleBundle::TRANSLATION_DOMAIN],
            ]);
            $schedule->addChild($calendar);

            $archive = $this->factory->createItem('menu_item.schedule_archive', [
                'route' => 'bkstg_schedule_archive',
                'routeParameters' => ['production_slug' => $group->getSlug()],
                'extras' => ['translation_domain' => BkstgScheduleBundle::TRANSLATION_DOMAIN],
            ]);
            $schedule->addChild($archive);
        }
    }
public function addScheduleItem ( ProductionMenuCollectionEvent $ event ) : void { $ menu = $ event -> getMenu ( ) ; $ group = $ event -> getGroup ( ) ; // Create overview menu item. $ schedule = $ this -> factory -> createItem ( 'menu_item.schedule' , [ 'route' => 'bkstg_calendar_production' , 'routeParameters' => [ 'production_slug' => $ group -> getSlug ( ) ] , 'extras' => [ 'icon' => 'calendar' , 'translation_domain' => BkstgScheduleBundle :: TRANSLATION_DOMAIN , ] , ] ) ; $ menu -> addChild ( $ schedule ) ; // If this user is an editor create the calendar and archive items. if ( $ this -> auth -> isGranted ( 'GROUP_ROLE_EDITOR' , $ group ) ) { $ calendar = $ this -> factory -> createItem ( 'menu_item.schedule_calendar' , [ 'route' => 'bkstg_calendar_production' , 'routeParameters' => [ 'production_slug' => $ group -> getSlug ( ) ] , 'extras' => [ 'translation_domain' => BkstgScheduleBundle :: TRANSLATION_DOMAIN ] , ] ) ; $ schedule -> addChild ( $ calendar ) ; $ archive = $ this -> factory -> createItem ( 'menu_item.schedule_archive' , [ 'route' => 'bkstg_schedule_archive' , 'routeParameters' => [ 'production_slug' => $ group -> getSlug ( ) ] , 'extras' => [ 'translation_domain' => BkstgScheduleBundle :: TRANSLATION_DOMAIN ] , ] ) ; $ schedule -> addChild ( $ archive ) ; } }
Add the schedule menu item.

@param ProductionMenuCollectionEvent $event The menu collection event.

@return void
Add the schedule menu item .