You are here

protected function LayoutBuilderContextTrait::contextRepository in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/layout_builder/src/Context/LayoutBuilderContextTrait.php \Drupal\layout_builder\Context\LayoutBuilderContextTrait::contextRepository()

Gets the context repository service.

Return value

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

File

core/modules/layout_builder/src/Context/LayoutBuilderContextTrait.php, line 26

Class

LayoutBuilderContextTrait
Provides a wrapper around getting contexts from a section storage object.

Namespace

Drupal\layout_builder\Context

Code

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