You are here

public function Context::calculateReactionDependencies in Context 8.4

Set context dependencies based on the reactions set.

Parameters

\Drupal\context\Plugin\ContextReactionPluginCollection $reaction_collection: The Reaction Plugin collection.

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

File

src/Entity/Context.php, line 417

Class

Context
Defines the Context entity.

Namespace

Drupal\context\Entity

Code

public function calculateReactionDependencies(ContextReactionPluginCollection $reaction_collection) {
  $instance_ids = $reaction_collection
    ->getInstanceIds();
  foreach ($instance_ids as $instance_id) {

    /** @var \Drupal\context\ContextReactionPluginBase $plugin */
    $plugin = $reaction_collection
      ->get($instance_id);
    $plugin_dependencies = $this
      ->getPluginDependencies($plugin);
    $this
      ->addDependencies($plugin_dependencies);
  }
}