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

        // Create resource menu item.
        $resources = $this->factory->createItem('menu_item.resources', [
            'route' => 'bkstg_resource_index',
            'routeParameters' => ['production_slug' => $group->getSlug()],
            'extras' => [
                'icon' => 'file',
                'translation_domain' => BkstgResourceBundle::TRANSLATION_DOMAIN,
            ],
        ]);
        $menu->addChild($resources);

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

            $archive = $this->factory->createItem('menu_item.resources_archive', [
                'route' => 'bkstg_resource_archive',
                'routeParameters' => ['production_slug' => $group->getSlug()],
                'extras' => ['translation_domain' => BkstgResourceBundle::TRANSLATION_DOMAIN],
            ]);
            $resources->addChild($archive);
        }
    }
public function addResourceItem(ProductionMenuCollectionEvent $event): void
    {
        $menu = $event->getMenu();
        $group = $event->getGroup();

        // Create resource menu item.
        $resources = $this->factory->createItem('menu_item.resources', [
            'route' => 'bkstg_resource_index',
            'routeParameters' => ['production_slug' => $group->getSlug()],
            'extras' => [
                'icon' => 'file',
                'translation_domain' => BkstgResourceBundle::TRANSLATION_DOMAIN,
            ],
        ]);
        $menu->addChild($resources);

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

            $archive = $this->factory->createItem('menu_item.resources_archive', [
                'route' => 'bkstg_resource_archive',
                'routeParameters' => ['production_slug' => $group->getSlug()],
                'extras' => ['translation_domain' => BkstgResourceBundle::TRANSLATION_DOMAIN],
            ]);
            $resources->addChild($archive);
        }
    }
public function addResourceItem ( ProductionMenuCollectionEvent $ event ) : void { $ menu = $ event -> getMenu ( ) ; $ group = $ event -> getGroup ( ) ; // Create resource menu item. $ resources = $ this -> factory -> createItem ( 'menu_item.resources' , [ 'route' => 'bkstg_resource_index' , 'routeParameters' => [ 'production_slug' => $ group -> getSlug ( ) ] , 'extras' => [ 'icon' => 'file' , 'translation_domain' => BkstgResourceBundle :: TRANSLATION_DOMAIN , ] , ] ) ; $ menu -> addChild ( $ resources ) ; // If this user is an editor create the post and archive items. if ( $ this -> auth -> isGranted ( 'GROUP_ROLE_EDITOR' , $ group ) ) { $ resources_resources = $ this -> factory -> createItem ( 'menu_item.resources_resources' , [ 'route' => 'bkstg_resource_index' , 'routeParameters' => [ 'production_slug' => $ group -> getSlug ( ) ] , 'extras' => [ 'translation_domain' => BkstgResourceBundle :: TRANSLATION_DOMAIN ] , ] ) ; $ resources -> addChild ( $ resources_resources ) ; $ archive = $ this -> factory -> createItem ( 'menu_item.resources_archive' , [ 'route' => 'bkstg_resource_archive' , 'routeParameters' => [ 'production_slug' => $ group -> getSlug ( ) ] , 'extras' => [ 'translation_domain' => BkstgResourceBundle :: TRANSLATION_DOMAIN ] , ] ) ; $ resources -> addChild ( $ archive ) ; } }
Add the resource menu items.

@param ProductionMenuCollectionEvent $event The menu collection event.

@return void
Add the resource menu items .