/** * Getters of every toolbar's plugins * Note that plugin must be registered in application's service container with 'toolbar.plugin' tag * to be recognized by PluginManager as toolbar plugin. * * @return array */ public function getPlugins() { $plugins = []; foreach (array_keys($this->container->findTaggedServiceIds(self::PLUGIN_SERVICE_TAG)) as $service_id) { $plugin = $this->container->get($service_id); if ($this->isValidPlugin($plugin)) { $plugins[] = $plugin; } } return $plugins; }
/** * constructor. * * @param ContainerInterface $container the container from where we get every validators */ public function __construct(ContainerInterface $container) { $this->validators = array(); foreach (array_keys($container->findTaggedServiceIds(self::VALIDATOR_SERVICE_TAG)) as $service_id) { $this->addValidator($container->get($service_id)); } }
/** * constructor. * * @param ContainerInterface $container service container from where we will retrieve every identifier appenders */ public function __construct(ContainerInterface $container) { $this->appenders = array(); foreach (array_keys($container->findTaggedServiceIds(self::APPENDER_SERVICE_TAG)) as $appender_id) { $this->addAppender($container->get($appender_id)); } }
/** * Loads bundles routes into application's router. */ public function loadBundlesRoutes() { $loadedBundles = array_keys($this->container->findTaggedServiceIds('bundle.config')); foreach ($loadedBundles as $serviceId) { $config = $this->container->get($serviceId); $recipes = $this->getLoaderRecipesByConfig($config); $this->loadRoutes($config, $this->getCallbackFromRecipes($recipes, self::ROUTE_RECIPE_KEY)); } }