DependentPluginDefinitionTrait.php

Same filename in other branches
  1. 8.9.x core/lib/Drupal/Core/Plugin/Definition/DependentPluginDefinitionTrait.php
  2. 10 core/lib/Drupal/Core/Plugin/Definition/DependentPluginDefinitionTrait.php
  3. 11.x core/lib/Drupal/Core/Plugin/Definition/DependentPluginDefinitionTrait.php

Namespace

Drupal\Core\Plugin\Definition

File

core/lib/Drupal/Core/Plugin/Definition/DependentPluginDefinitionTrait.php

View source
<?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;
    }

}

Traits

Title Deprecated Summary
DependentPluginDefinitionTrait Provides a trait for a plugin definition that has dependencies.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.