Mounts the controllers defined in registerControllers().

@param MountEvent $event

@internal
550612
final public function onMountControllers(MountEvent $event)
    {
        foreach ($this->registerFrontendControllers() as $prefix => $collection) {
            $event->mount($prefix, $collection);
        }

        $app = $this->getContainer();
        $backendPrefix = $app['controller.backend.mount_prefix'];
        foreach ($this->registerBackendControllers() as $prefix => $collection) {
            $event->mount($backendPrefix . '/' . ltrim($prefix, '/'), $collection);
        }
    }
1013338
public static function installLegacySymlinks(Event $event): void
    {
        $options = static::getOptions($event);
        $consoleDir = static::getConsoleDir($event, 'install legacy symlinks');

        static::executeCommand($event, $consoleDir, 'ngsite:symlink:legacy', $options['process-timeout']);
    }
49109
protected function handle($event): void
    {
        $method = $this->getApplyMethod($event);

        if (!method_exists($this, $method)) {
            return;
        }

        $this->$method($event);
    }
705018
public function beforeFilter(Event $event)
    {
        EventManager::trigger('Controller.setup', $this);

        $pluginEvent = Plugin::getData('Core', 'Controller.beforeFilter');
        if (is_callable($pluginEvent->find(0)) && Plugin::hasManifestEvent('Controller.beforeFilter')) {
            call_user_func_array($pluginEvent->find(0), [$this, $event]);
        }
    }
212986
public function onKernelController(FilterControllerEvent $event)
    {
        $controller = $event->getController();

        /*
         * $controller passed can be either a class or a Closure.
         * This is not usual in Symfony but it may happen.
         * If it is a class, it comes in array format
         */
        if (!is_array($controller)) {
            return;
        }
        $fqcn = get_class($controller[0]);
        $isMediaManagerBundleController = $this->startsWith($fqcn, 'Phlexible\Bundle\MediaManagerBundle\Controller');
        if ($isMediaManagerBundleController && !$this->checkDefaultVolumeExists()) {
            throw new \Exception('No default volume found. Maybe you haven\'t initialized the MediaManager yet?');
        }
    }
302937
public function addController($mount = null, $handler = null, $info = null)
    {
        $this->addRoute(null, $mount, null, $handler, $info);
    }
1366361
public static function registerPackage(Event $event)
    {
        $installedPackage = $event->getOperation()->getPackage();

        if (!self::isBundle($installedPackage)) {
            return;
        }

        self::enablePackage($installedPackage);
    }
421594
public function onKernelController(FilterControllerEvent $event)
    {
        $request = $event->getRequest();
        $route = $this->routes->get($request->attributes->get('_route'));
        if ($route && $converters = $route->getOption('_converters')) {
            foreach ($converters as $name => $callback) {
                $callback = $this->callbackResolver->resolveCallback($callback);

                $request->attributes->set($name, call_user_func($callback, $request->attributes->get($name), $request));
            }
        }
    }
1270926
protected function fireEvent($event)
    {
        $this->app['events']->dispatch(sprintf('modules.%s.' . $event, $this->getLowerName()), [$this]);
    }
628259
public function onKernelControllerArguments(FilterControllerArgumentsEvent $event): void
    {
        $arguments = $event->getArguments();

        foreach ($arguments as $argument) {
            if ($argument instanceof ResourceInterface) {
                $violationList = $this->validator->validate($argument);

                if (count($violationList)) {
                    throw ViolationListException::create($violationList);
                }
            }
        }
    }
252208
public function onKernelController(FilterControllerEvent $event)
    {
        $controller = $event->getController();
        $request = $event->getRequest();
        $configurations = [];

        if ($configuration = $request->attributes->get('_converters')) {
            foreach (\is_array($configuration) ? $configuration : [$configuration] as $configuration) {
                $configurations[$configuration->getName()] = $configuration;
            }
        }

        if (\is_array($controller)) {
            $r = new \ReflectionMethod($controller[0], $controller[1]);
        } elseif (\is_object($controller) && \is_callable([$controller, '__invoke'])) {
            $r = new \ReflectionMethod($controller, '__invoke');
        } else {
            $r = new \ReflectionFunction($controller);
        }

        // automatically apply conversion for non-configured objects
        if ($this->autoConvert) {
            $configurations = $this->autoConfigure($r, $request, $configurations);
        }

        $this->manager->apply($request, $configurations);
    }
628337
public function initialize(Event $event) {
		$table = $event->getSubject();
		if (!in_array(get_class($table), $this->config['tableClass'])) {
			return;
		}

		$this->_setValidators($table);
	}
14688
public function mount(): void
    {
        if (count($this->collections) > 0) {
            foreach ($this->collections as $collection) {
                $micro = new MicroCollection();
                // Set the main handler. ie. a controller instance
                $micro->setHandler($collection['className'], true);
                // Set a common prefix for all routes

                if ($this->prefix) {
                    $micro->setPrefix($this->prefix);
                }

                // Use the method 'index' in PostsController
                $micro->{$collection['method']}($collection['pattern'], $collection['function']);

                $this->application->mount($micro);
            }
        }

        return;
    }
587333
public static function configureProject(Event $event)
    {
        DirectoryConfigurator::fromEvent($event)->run();
        BundleConfigurator::fromEvent($event)->run();

        // Install assets here since they they were skipped above
        static::installAssets($event, false);
    }
167662
public function onPackageAfterExecute(Event $event)
    {
        /**
         * @var AbstractPackage    $package
         * @var AbstractController $controller
         */
        $package    = $event['package'];
        $controller = $event['controller'];

        /**
         * @var Container $container
         * @var Collector $collector
         * @var Profiler  $profiler
         */
        $container = $package->getContainer();
        $collector = $container->get('debugger.collector');
        $profiler  = $container->get('profiler');

        $collector['controller.main'] = get_class($controller);

        $collector->push('controller.executed', [
            'controller' => get_class($controller),
            'task' => $event['task'],
            'input' => $controller->getInput()->toArray(),
            'variables' => $event['variables'],
        ]);

        $name = $package->getName();

        $profiler->mark(__FUNCTION__ . ' / ' . $name . ' (' . uniqid() . ')', [
            'tag' => 'package.process',
        ]);
    }
1363411
public function attach(ActionEventDispatcher $events)
    {
        $this->trackHandler($events->attachListener(MessageDispatch::INITIALIZE, $this));
    }
1215958
public function bindPluginEvents(Event $event)
    {
        foreach ($this->plugins as $field => $plugin) {
            $plugin = self::findPluginInstance($field, $plugin, $event->sender->tableName());
            foreach ($plugin->events() as $on => $handler) {
                $event->sender->on($on, is_string($handler) ? [$plugin, $handler] : $handler);
            }
        }
    }