DependencyTrait::addDependencies

protected DependencyTrait::addDependencies(array $dependencies)

Adds multiple dependencies.

Parameters

array $dependencies.: An array of dependencies keyed by the type of dependency. One example:

  array(
    'module' => array(
      'node',
      'field',
      'image',
    ),
  );
  

See also

\Drupal\Core\Entity\DependencyTrait::addDependency

File

core/lib/Drupal/Core/Entity/DependencyTrait.php, line 64

Class

DependencyTrait
Provides a trait for managing an object's dependencies.

Namespace

Drupal\Core\Entity

Code

protected function addDependencies(array $dependencies) {
  foreach ($dependencies as $dependency_type => $list) {
    foreach ($list as $name) {
      $this->addDependency($dependency_type, $name);
    }
  }
}
doc_Drupal
2016-10-29 09:02:15
Comments
Leave a Comment

Please login to continue.