Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ConfigEntityBase.php

function ConfigEntityBase::addDependency

Overrides \Drupal\Core\Entity\DependencyTrait:addDependency().

Note that this function should only be called from implementations of \Drupal\Core\Config\Entity\ConfigEntityInterface::calculateDependencies(), as dependencies are recalculated during every entity save.

See also

\Drupal\Core\Config\Entity\ConfigEntityDependency::hasDependency()

13 calls to ConfigEntityBase::addDependency()
Block::calculateDependencies in core/modules/block/src/Entity/Block.php
Calculates dependencies and stores them in the dependency property.
ConfigEntityBase::calculateDependencies in core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php
Calculates dependencies and stores them in the dependency property.
ContentLanguageSettings::calculateDependencies in core/modules/language/src/Entity/ContentLanguageSettings.php
Calculates dependencies and stores them in the dependency property.
Editor::calculateDependencies in core/modules/editor/src/Entity/Editor.php
Calculates dependencies and stores them in the dependency property.
EntityDisplayBase::calculateDependencies in core/lib/Drupal/Core/Entity/EntityDisplayBase.php
Calculates dependencies and stores them in the dependency property.

... See full list

File

core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php, line 429

Class

ConfigEntityBase
Defines a base configuration entity class.

Namespace

Drupal\Core\Config\Entity

Code

protected function addDependency($type, $name) {
    // A config entity is always dependent on its provider. There is no need to
    // explicitly declare the dependency. An explicit dependency on Core, which
    // provides some plugins, is also not needed.
    if ($type == 'module' && ($name == $this->getEntityType()
        ->getProvider() || $name == 'core')) {
        return $this;
    }
    return $this->addDependencyTrait($type, $name);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal