You are here

public function ContextManager::evaluateContexts in Context 8.4

Same name and namespace in other branches
  1. 8 src/ContextManager.php \Drupal\context\ContextManager::evaluateContexts()
  2. 8.0 src/ContextManager.php \Drupal\context\ContextManager::evaluateContexts()

Evaluate all context conditions.

1 call to ContextManager::evaluateContexts()
ContextManager::getActiveContexts in src/ContextManager.php
Get the evaluated and active contexts.

File

src/ContextManager.php, line 249

Class

ContextManager
This is the manager service for the context module.

Namespace

Drupal\context

Code

public function evaluateContexts() {

  /** @var \Drupal\context\ContextInterface $context */
  foreach ($this
    ->getContexts() as $context) {
    if ($this
      ->evaluateContextConditions($context) && !$context
      ->disabled()) {
      $this->activeContexts[] = $context;
    }
  }
  $this->contextConditionsEvaluated = TRUE;
}