add global menu items.

@param Event $event

@return \Knp\Menu\ItemInterface

@SuppressWarnings checkUnusedFunctionParameters
505107
public function addGlobal(Event $event)
    {
        $topNavbar = $this->menuBuilder->getTopNavbar();

        $topNavbar
            ->addChild('menu.sitemap', [
                'route' => 'victoire_sitemap_reorganize',
            ])
            ->setLinkAttribute('data-toggle', 'vic-modal');
    }
280805
public function create(Event $event)
    {
        return $this->cache->store($this->store)->add(
            $event->mutexName(), true, $event->expiresAt * 60
        );
    }
271232
protected static function instantiateConsoleInteraction(Event $event) {
        $consoleIO                = $event->getIO();
        self::$consoleInteraction = new ConsoleInteraction(new Input($consoleIO), new Output($consoleIO));
    }
921020
public function onKernelRequest(ConfigureMenuEvent $event)
    {
        $menu = $event->getMenu();
        $menu->addChild(
            'LDAP',
            [
                'route' => 'claro_admin_ldap',
            ]
        )->setExtra('name', 'LDAP');

        return $menu;
    }
791988
public function onMenuConfigure(ConfigureMenuEvent $event)
    {
        if (!$this->permissionResolver->hasAccess('uicron', 'list')) {
            return;
        }

        $menu = $event->getMenu();

        $cronsMenu = $menu->getChild(MainMenuBuilder::ITEM_ADMIN);
        $cronsMenu->addChild(self::ITEM_CRONS, ['route' => 'edgar.ezuicron.list']);
    }
609492
public function dispatchEvent($event) {
		$type = $event->getType();
		if (isset($this->eventsListeners[$type])) {
			for ($j = 0; $j < count($this->eventsListeners[$type]); $j++) {
				list($plugin, $action) = explode(':', $this->eventsListeners[$type][$j]);
				//加载plugin && 调用action
				//echo $type.'<br/>';
				$this->app->runPluginAction($plugin, $action, $event);
			}
		}
		
	}
1015274
protected function create(Event $event)
    {
        $this->dispatch(static::EVENT_CREATE_BEFORE, $event);
        if (!$event->isPropagationStopped()) {
            $this->createProcess($event);
            if (!$event->isPropagationStopped()) {
                $this->dispatch(static::EVENT_CREATE_AFTER, $event);
            }
        }
    }
732478
public static function createMenuItem(array $item): MenuItemInterface
    {
        $menuItem = static::_getMenuItemObject($item);
        foreach ($item as $key => $value) {
            if ($key == 'children') {
                foreach ($value as $k => $v) {
                    $childItem = static::createMenuItem($v);
                    $menuItem->addMenuItem($childItem);
                }
            } elseif ($key == 'attributes') {
                foreach ($value as $k => $v) {
                    $menuItem->addAttribute($k, $v);
                }
            } elseif ($key == 'viewElement') {
                call_user_func_array([$menuItem, 'setViewElement'], $value);
            } else {
                $method = 'set' . ucfirst(Inflector::camelize($key));
                if (method_exists($menuItem, $method)) {
                    $menuItem->$method($value);
                }
            }
        }

        return $menuItem;
    }
1072221
public function dispatch($event)
    {
        if ($event instanceof AbstractEvent) {
            $this->dispatcher->dispatch($event->getEventName(), $event);
        } else {
            $this->dispatcher->dispatch($event);
        }
        return $this;
    }
915593
public function addGlobal(Event $event)
    {
        $this->mainItem = $this->menuBuilder->getBottomLeftNavbar()->getChild('menu.additionals');

        if ($this->menuBuilder->isGranted('ROLE_VICTOIRE_BET')) {
            $this
                ->mainItem
                ->addChild(
                    'menu.business_template',
                    [
                        'route'          => 'victoire_business_template_index',
                        'linkAttributes' => [
                            'class' => 'v-drop__anchor',
                        ],
                    ]
                )
                ->setLinkAttribute('data-toggle', 'vic-modal');
        }

        return $this->mainItem;
    }
1361756
public function onEventRegistration(Event $event)
    {
        $this->unitOfWork->publishEvent($event, $this->eventBus);

        return $this->unitOfWork->invokeEventRegistrationListeners($event);
    }
369797
public function addContextual($event)
    {
        $page = $event->getPage();
        $currentArticle = $event->getPage()->getBusinessEntity();

        $bottomRightNavbar = $this->menuBuilder->getBottomRightNavbar();

        $bottomRightNavbar->addChild('menu.page.settings',
            [
                'route'           => 'victoire_blog_article_settings',
                'routeParameters' => [
                    'id'      => $currentArticle->getId(),
                    'page_id' => $page->getId(),
                ],
                'linkAttributes' => [
                    'class' => 'v-btn v-btn--sm v-btn--transparent',
                    'id'    => 'v-settings-link',
                ],
            ]
        )->setLinkAttribute('data-toggle', 'vic-modal');
    }
806351
public function buildFromEvent(Event $event)
    {
        $this->setEvent($event);

        $configs = $this->getConfigFilesByComposer();
        $this->addFindersByConfigs($configs);

        // We have to initialize composer autoload
        require_once 'vendor/autoload.php';

        $this->build();
    }
1128349
public static function importRoutes(Event $event) {
        $options = self::getOptions($event);
        $appDir = $options['symfony-app-dir'];
        $webDir = $options['symfony-web-dir'];

        if (!is_dir($webDir)) {
            echo 'The symfony-web-dir (' . $webDir . ') specified in composer.json was not found in ' . getcwd() . ', can not install assets.' . PHP_EOL;

            return;
        }

        static::executeCommand($event, $appDir, 'wucdbm_menu_builder:import_routes');
    }
46768
private function applyRegistrationCallbacks(Event $event)
    {
        foreach ($this->registrationCallbacks as $callback) {
            $event = $callback->onEventRegistration($event);
        }

        return $event;
    }
1125716
public function onExternalAuthenticationMenuConfigure(ConfigureMenuEvent $event)
    {
        $menu = $event->getMenu();
        foreach (OauthConfiguration::resourceOwners() as $resourceOwner) {
            $menu->addChild(
                $resourceOwner,
                [
                    'route' => 'claro_admin_oauth_form',
                    'routeParameters' => ['service' => str_replace(' ', '_', strtolower($resourceOwner))],
                ]
            )->setExtra('name', $resourceOwner);
        }

        return $menu;
    }
92916
public function setEvent($event = [])
    {
        if (!empty($event['id'])) {
            $this->setLogs($event['id'], 'campaignEventId');
        }
        $overrides = [];
        if (!empty($event['config']['contactclient_overrides'])) {
            // Flatten overrides to key-value pairs.
            $jsonHelper = new JSONHelper();
            $array      = $jsonHelper->decodeArray($event['config']['contactclient_overrides'], 'Overrides');
            if ($array) {
                foreach ($array as $field) {
                    if (!empty($field->key) && !empty($field->value) && (empty($field->enabled) || true === $field->enabled)) {
                        $overrides[$field->key] = $field->value;
                    }
                }
            }
            if ($overrides) {
                $this->setOverrides($overrides);
            }
        }
        $this->event = $event;

        return $this;
    }