You are here

trait PluginConfigDependenciesDefinitionTrait in Plugin 8.2

Implements \Drupal\Core\Plugin\PluginConfigDependenciesDefinitionInterface.

Hierarchy

1 file declares its use of PluginConfigDependenciesDefinitionTrait
PluginConfigDependenciesDefinitionTraitTest.php in tests/src/Unit/PluginDefinition/PluginConfigDependenciesDefinitionTraitTest.php

File

src/PluginDefinition/PluginConfigDependenciesDefinitionTrait.php, line 10

Namespace

Drupal\plugin\PluginDefinition
View source
trait PluginConfigDependenciesDefinitionTrait {

  /**
   * The dependencies.
   *
   * @var array[]
   *   An array of dependencies keyed by the type of dependency. One example:
   *   @code
   *   array(
   *     'module' => array(
   *       'node',
   *       'field',
   *       'image',
   *     ),
   *   );
   *   @endcode
   *
   * @return $this
   */
  protected $configDependencies = [];

  /**
   * Implements \Drupal\Core\Plugin\PluginConfigDependenciesDefinitionInterface::setConfigDependencies().
   */
  public function setConfigDependencies(array $dependencies) {
    $this->configDependencies = $dependencies;
    return $this;
  }

  /**
   * Implements \Drupal\Core\Plugin\PluginConfigDependenciesDefinitionInterface::getConfigDependencies().
   */
  public function getConfigDependencies() {
    return $this->configDependencies;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
PluginConfigDependenciesDefinitionTrait::$configDependencies protected property The dependencies.
PluginConfigDependenciesDefinitionTrait::getConfigDependencies public function Implements \Drupal\Core\Plugin\PluginConfigDependenciesDefinitionInterface::getConfigDependencies().
PluginConfigDependenciesDefinitionTrait::setConfigDependencies public function Implements \Drupal\Core\Plugin\PluginConfigDependenciesDefinitionInterface::setConfigDependencies().