function GlobalContextRepositoryTrait::getGlobalContextRepository

Gets the global context repository.

Return value

\Drupal\Core\Plugin\Context\ContextRepositoryInterface The context repository.

File

src/Context/GlobalContextRepositoryTrait.php, line 38

Class

GlobalContextRepositoryTrait
Trait for classes that depend on the global context repository.

Namespace

Drupal\rules\Context

Code

public function getGlobalContextRepository() {
    if (empty($this->contextRepository)) {
        $this->contextRepository = \Drupal::service('context.repository');
    }
    return $this->contextRepository;
}