public function createProductionMenu(array $options): ItemInterface
    {
        $menu = $this->factory->createItem('root');

        // No group context means return empty menu.
        if (null === $group = $this->group_context->getContext()) {
            return $menu;
        }

        $menu->setLabel($group->getName());
        $menu->setExtra('translation_domain', false);

        // Dispatch event to populate the menu.
        $event = new ProductionMenuCollectionEvent($menu, $group);
        $this->dispatcher->dispatch(ProductionMenuCollectionEvent::NAME, $event);

        return $menu;
    }
public function createProductionMenu(array $options): ItemInterface
    {
        $menu = $this->factory->createItem('root');

        // No group context means return empty menu.
        if (null === $group = $this->group_context->getContext()) {
            return $menu;
        }

        $menu->setLabel($group->getName());
        $menu->setExtra('translation_domain', false);

        // Dispatch event to populate the menu.
        $event = new ProductionMenuCollectionEvent($menu, $group);
        $this->dispatcher->dispatch(ProductionMenuCollectionEvent::NAME, $event);

        return $menu;
    }
public function createProductionMenu ( array $ options ) : ItemInterface { $ menu = $ this -> factory -> createItem ( 'root' ) ; // No group context means return empty menu. if ( null === $ group = $ this -> group_context -> getContext ( ) ) { return $ menu ; } $ menu -> setLabel ( $ group -> getName ( ) ) ; $ menu -> setExtra ( 'translation_domain' , false ) ; // Dispatch event to populate the menu. $ event = new ProductionMenuCollectionEvent ( $ menu , $ group ) ; $ this -> dispatcher -> dispatch ( ProductionMenuCollectionEvent :: NAME , $ event ) ; return $ menu ; }
Create the production menu.

@param array $options The options for the menu.

@return ItemInterface The menu.
Create the production menu .