You are here

protected function TwigExtensionBase::getEntityRepository in Bamboo Twig 8.5

Same name and namespace in other branches
  1. 8.4 src/TwigExtension/TwigExtensionBase.php \Drupal\bamboo_twig\TwigExtension\TwigExtensionBase::getEntityRepository()

Lazy loading for the Drupal entity repository.

Return value

\Drupal\Core\Entity\EntityRepositoryInterface Return the Drupal entity repository.

2 calls to TwigExtensionBase::getEntityRepository()
I18n::getTranslation in bamboo_twig_i18n/src/TwigExtension/I18n.php
Gets a translation of the entity.
Loader::loadEntity in bamboo_twig_loader/src/TwigExtension/Loader.php
Returns an entity object in the current context language.

File

src/TwigExtension/TwigExtensionBase.php, line 37

Class

TwigExtensionBase
Provides a Twig Extension Lazy Service Injection.

Namespace

Drupal\bamboo_twig\TwigExtension

Code

protected function getEntityRepository() {
  return $this->container
    ->get('entity.repository');
}