/**
  * {@inheritdoc}
  */
 protected function getDiscovery()
 {
     if (!isset($this->discovery)) {
         $this->discovery = new YamlDiscovery('jcarousel.skins', $this->moduleHandler->getModuleDirectories() + $this->themeHandler->getThemeDirectories());
         $this->discovery = new ContainerDerivativeDiscoveryDecorator($this->discovery);
     }
     return $this->discovery;
 }
 /**
  * Constructs a LayoutPluginManager object.
  *
  * @param \Traversable $namespaces
  *   An object that implements \Traversable which contains the root paths
  *   keyed by the corresponding namespace to look for plugin implementations.
  * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
  *   Cache backend instance to use.
  * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
  *   The module handler to invoke the alter hook with.
  * @param \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler
  *   The theme handle to invoke the alter hook with.
  */
 public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, ThemeHandlerInterface $theme_handler)
 {
     $plugin_interface = 'Drupal\\layout_plugin\\Plugin\\Layout\\LayoutInterface';
     $plugin_definition_annotation_name = 'Drupal\\layout_plugin\\Annotation\\Layout';
     parent::__construct("Plugin/Layout", $namespaces, $module_handler, $plugin_interface, $plugin_definition_annotation_name);
     $discovery = $this->getDiscovery();
     $this->discovery = new YamlDiscoveryDecorator($discovery, 'layouts', $module_handler->getModuleDirectories() + $theme_handler->getThemeDirectories());
     $this->themeHandler = $theme_handler;
     $this->defaults += array('type' => 'page', 'class' => 'Drupal\\layout_plugin\\Plugin\\Layout\\LayoutDefault');
     $this->setCacheBackend($cache_backend, 'layout');
     $this->alterInfo('layout');
 }
Example #3
0
 /**
  * Constructs a new BreakpointManager instance.
  *
  * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
  *   The module handler.
  * @param \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler
  *   The theme handler.
  * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
  *   The cache backend.
  * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation
  *   The string translation service.
  */
 public function __construct(ModuleHandlerInterface $module_handler, ThemeHandlerInterface $theme_handler, CacheBackendInterface $cache_backend, TranslationInterface $string_translation)
 {
     $this->discovery = new YamlDiscovery('breakpoints', $module_handler->getModuleDirectories() + $theme_handler->getThemeDirectories());
     $this->discovery = new ContainerDerivativeDiscoveryDecorator($this->discovery);
     $this->factory = new ContainerFactory($this);
     $this->moduleHandler = $module_handler;
     $this->themeHandler = $theme_handler;
     $this->setStringTranslation($string_translation);
     $this->alterInfo('breakpoints');
     $this->setCacheBackend($cache_backend, 'breakpoints', array('breakpoints'));
 }