public function addScheduleMenuItem(UserMenuCollectionEvent $event): void
    {
        // Get the menu from the event.
        $menu = $event->getMenu();

        // Create a separator first.
        $separator = $this->factory->createItem('schedule_separator', [
            'extras' => [
                'separator' => true,
                'translation_domain' => false,
            ],
        ]);
        $menu->addChild($separator);

        // Add link to user's calendar.
        $schedule = $this->factory->createItem('menu_item.my_schedule', [
            'route' => 'bkstg_calendar_personal',
            'extras' => [
                'icon' => 'calendar',
                'translation_domain' => BkstgScheduleBundle::TRANSLATION_DOMAIN,
            ],
        ]);
        $menu->addChild($schedule);
    }
public function addScheduleMenuItem(UserMenuCollectionEvent $event): void
    {
        // Get the menu from the event.
        $menu = $event->getMenu();

        // Create a separator first.
        $separator = $this->factory->createItem('schedule_separator', [
            'extras' => [
                'separator' => true,
                'translation_domain' => false,
            ],
        ]);
        $menu->addChild($separator);

        // Add link to user's calendar.
        $schedule = $this->factory->createItem('menu_item.my_schedule', [
            'route' => 'bkstg_calendar_personal',
            'extras' => [
                'icon' => 'calendar',
                'translation_domain' => BkstgScheduleBundle::TRANSLATION_DOMAIN,
            ],
        ]);
        $menu->addChild($schedule);
    }
public function addScheduleMenuItem ( UserMenuCollectionEvent $ event ) : void { // Get the menu from the event. $ menu = $ event -> getMenu ( ) ; // Create a separator first. $ separator = $ this -> factory -> createItem ( 'schedule_separator' , [ 'extras' => [ 'separator' => true , 'translation_domain' => false , ] , ] ) ; $ menu -> addChild ( $ separator ) ; // Add link to user's calendar. $ schedule = $ this -> factory -> createItem ( 'menu_item.my_schedule' , [ 'route' => 'bkstg_calendar_personal' , 'extras' => [ 'icon' => 'calendar' , 'translation_domain' => BkstgScheduleBundle :: TRANSLATION_DOMAIN , ] , ] ) ; $ menu -> addChild ( $ schedule ) ; }
Add the schedule items to the user menu.

@param UserMenuCollectionEvent $event The menu collection event.

@return void
Add the schedule items to the user menu .