Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / lib / Drupal / Core / Layout / LayoutPluginManager.php
index 179d1ede9ab7392aaaae32c3d08a7875131d3f4b..a5a465293775b4b75c7d84899d44bcba1f28eb3a 100644 (file)
@@ -12,12 +12,15 @@ use Drupal\Core\Plugin\Discovery\AnnotatedClassDiscovery;
 use Drupal\Core\Plugin\Discovery\ContainerDerivativeDiscoveryDecorator;
 use Drupal\Core\Plugin\Discovery\YamlDiscoveryDecorator;
 use Drupal\Core\Layout\Annotation\Layout;
+use Drupal\Core\Plugin\FilteredPluginManagerTrait;
 
 /**
  * Provides a plugin manager for layouts.
  */
 class LayoutPluginManager extends DefaultPluginManager implements LayoutPluginManagerInterface {
 
+  use FilteredPluginManagerTrait;
+
   /**
    * The theme handler.
    *
@@ -42,8 +45,16 @@ class LayoutPluginManager extends DefaultPluginManager implements LayoutPluginMa
     parent::__construct('Plugin/Layout', $namespaces, $module_handler, LayoutInterface::class, Layout::class);
     $this->themeHandler = $theme_handler;
 
-    $this->setCacheBackend($cache_backend, 'layout');
-    $this->alterInfo('layout');
+    $type = $this->getType();
+    $this->setCacheBackend($cache_backend, $type);
+    $this->alterInfo($type);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function getType() {
+    return 'layout';
   }
 
   /**