You are here

public function Context::calculateConditionDependencies in Context 8.4

Set context dependencies based on the conditions set.

Parameters

\Drupal\Core\Condition\ConditionPluginCollection $condition_collection: The Condition Plugin collection.

1 call to Context::calculateConditionDependencies()
Context::calculateDependencies in src/Entity/Context.php
Calculates dependencies and stores them in the dependency property.

File

src/Entity/Context.php, line 433

Class

Context
Defines the Context entity.

Namespace

Drupal\context\Entity

Code

public function calculateConditionDependencies(ConditionPluginCollection $condition_collection) {
  $instance_ids = $condition_collection
    ->getInstanceIds();
  foreach ($instance_ids as $instance_id) {

    /** @var \Drupal\Core\Condition\ConditionPluginBase $plugin */
    $plugin = $condition_collection
      ->get($instance_id);
    $plugin_dependencies = $this
      ->getPluginDependencies($plugin);
    $this
      ->addDependencies($plugin_dependencies);
  }
}