You are here

public function ContextManager::getActiveContexts in Context 8.4

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

Get the evaluated and active contexts.

Return value

\Drupal\context\ContextInterface[] An array with the evaluated and active contexts.

1 call to ContextManager::getActiveContexts()
ContextManager::getActiveReactions in src/ContextManager.php
Get all active reactions or reactions of a certain type.

File

src/ContextManager.php, line 236

Class

ContextManager
This is the manager service for the context module.

Namespace

Drupal\context

Code

public function getActiveContexts() {
  if ($this
    ->conditionsHasBeenEvaluated()) {
    return $this->activeContexts;
  }
  $this
    ->evaluateContexts();
  return $this->activeContexts;
}