function Entity::calculateDependencies

Same name in this branch
  1. 10 core/modules/views/src/Plugin/views/area/Entity.php \Drupal\views\Plugin\views\area\Entity::calculateDependencies()
  2. 10 core/modules/migrate/src/Plugin/migrate/destination/Entity.php \Drupal\migrate\Plugin\migrate\destination\Entity::calculateDependencies()
Same name in other branches
  1. 9 core/modules/views/src/Plugin/views/argument_validator/Entity.php \Drupal\views\Plugin\views\argument_validator\Entity::calculateDependencies()
  2. 9 core/modules/views/src/Plugin/views/area/Entity.php \Drupal\views\Plugin\views\area\Entity::calculateDependencies()
  3. 9 core/modules/migrate/src/Plugin/migrate/destination/Entity.php \Drupal\migrate\Plugin\migrate\destination\Entity::calculateDependencies()
  4. 8.9.x core/modules/views/src/Plugin/views/argument_validator/Entity.php \Drupal\views\Plugin\views\argument_validator\Entity::calculateDependencies()
  5. 8.9.x core/modules/views/src/Plugin/views/area/Entity.php \Drupal\views\Plugin\views\area\Entity::calculateDependencies()
  6. 8.9.x core/modules/migrate/src/Plugin/migrate/destination/Entity.php \Drupal\migrate\Plugin\migrate\destination\Entity::calculateDependencies()
  7. 11.x core/modules/views/src/Plugin/views/argument_validator/Entity.php \Drupal\views\Plugin\views\argument_validator\Entity::calculateDependencies()
  8. 11.x core/modules/views/src/Plugin/views/area/Entity.php \Drupal\views\Plugin\views\area\Entity::calculateDependencies()
  9. 11.x core/modules/migrate/src/Plugin/migrate/destination/Entity.php \Drupal\migrate\Plugin\migrate\destination\Entity::calculateDependencies()

Overrides PluginBase::calculateDependencies

1 call to Entity::calculateDependencies()
User::calculateDependencies in core/modules/user/src/Plugin/views/argument_validator/User.php
Calculates dependencies for the configured plugin.
1 method overrides Entity::calculateDependencies()
User::calculateDependencies in core/modules/user/src/Plugin/views/argument_validator/User.php
Calculates dependencies for the configured plugin.

File

core/modules/views/src/Plugin/views/argument_validator/Entity.php, line 233

Class

Entity
Defines an argument validator plugin for each entity type.

Namespace

Drupal\views\Plugin\views\argument_validator

Code

public function calculateDependencies() {
    $dependencies = parent::calculateDependencies();
    $entity_type_id = $this->definition['entity_type'];
    $bundle_entity_type = $this->entityTypeManager
        ->getDefinition($entity_type_id)
        ->getBundleEntityType();
    // The bundle entity type might not exist. For example, users do not have
    // bundles.
    if ($this->entityTypeManager
        ->hasHandler($bundle_entity_type, 'storage')) {
        $bundle_entity_storage = $this->entityTypeManager
            ->getStorage($bundle_entity_type);
        foreach ($bundle_entity_storage->loadMultiple(array_keys($this->options['bundles'])) as $bundle_entity) {
            $dependencies[$bundle_entity->getConfigDependencyKey()][] = $bundle_entity->getConfigDependencyName();
        }
    }
    return $dependencies;
}

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