Version 1
[yaffs-website] / web / core / lib / Drupal / Core / Plugin / Definition / DependentPluginDefinitionTrait.php
diff --git a/web/core/lib/Drupal/Core/Plugin/Definition/DependentPluginDefinitionTrait.php b/web/core/lib/Drupal/Core/Plugin/Definition/DependentPluginDefinitionTrait.php
new file mode 100644 (file)
index 0000000..632bf0c
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+
+namespace Drupal\Core\Plugin\Definition;
+
+/**
+ * Provides a trait for a plugin definition that has dependencies.
+ */
+trait DependentPluginDefinitionTrait {
+
+  /**
+   * The dependencies of this plugin definition.
+   *
+   * @var array
+   *
+   * @see \Drupal\Core\Config\Entity\ConfigDependencyManager
+   */
+  protected $config_dependencies = [];
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getConfigDependencies() {
+    return $this->config_dependencies;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function setConfigDependencies(array $config_dependencies) {
+    $this->config_dependencies = $config_dependencies;
+    return $this;
+  }
+
+}