You are here

public function EntityBundle::calculateDependencies in Commerce Core 8.2

We override the parent method so that it does not cause an unhandled PluginNotFoundException to be thrown, due to entities which use bundle plugins.

Overrides Bundle::calculateDependencies

File

src/Plugin/views/filter/EntityBundle.php, line 104

Class

EntityBundle
Filters by entity bundle.

Namespace

Drupal\commerce\Plugin\views\filter

Code

public function calculateDependencies() {
  $parents_parent = get_parent_class(get_parent_class($this));
  $dependencies = $parents_parent::calculateDependencies();
  $bundle_entity_type = $this->entityType
    ->getBundleEntityType();
  if ($bundle_entity_type) {
    $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;
}