protected function LayoutBuilderContextTrait::contextRepository in Drupal 9
Same name and namespace in other branches
- 8 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\ContextCode
protected function contextRepository() {
if (!$this->contextRepository) {
$this->contextRepository = \Drupal::service('context.repository');
}
return $this->contextRepository;
}