function Bundle::calculateDependencies

Same name in other branches
  1. 9 core/modules/views/src/Plugin/views/filter/Bundle.php \Drupal\views\Plugin\views\filter\Bundle::calculateDependencies()
  2. 10 core/modules/views/src/Plugin/views/filter/Bundle.php \Drupal\views\Plugin\views\filter\Bundle::calculateDependencies()
  3. 11.x core/modules/views/src/Plugin/views/filter/Bundle.php \Drupal\views\Plugin\views\filter\Bundle::calculateDependencies()

Overrides HandlerBase::calculateDependencies

File

core/modules/views/src/Plugin/views/filter/Bundle.php, line 132

Class

Bundle
Filter class which allows filtering by entity bundles.

Namespace

Drupal\views\Plugin\views\filter

Code

public function calculateDependencies() {
    $dependencies = parent::calculateDependencies();
    $bundle_entity_type = $this->entityType
        ->getBundleEntityType();
    $bundle_entity_storage = $this->entityTypeManager
        ->getStorage($bundle_entity_type);
    foreach (array_keys($this->value) as $bundle) {
        if ($bundle_entity = $bundle_entity_storage->load($bundle)) {
            $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.