You are here

protected function BackgroundImage::getEntityRepository in Background Image 2.0.x

Same name and namespace in other branches
  1. 8 src/Entity/BackgroundImage.php \Drupal\background_image\Entity\BackgroundImage::getEntityRepository()
  2. 2.x src/Entity/BackgroundImage.php \Drupal\background_image\Entity\BackgroundImage::getEntityRepository()

Retrieves the Entity Repository service.

Return value

\Drupal\Core\Entity\EntityRepositoryInterface|mixed

File

src/Entity/BackgroundImage.php, line 327

Class

BackgroundImage
Defines the Background Image entity.

Namespace

Drupal\background_image\Entity

Code

protected function getEntityRepository() {
  if (!isset($this->entityRepository)) {
    $this->entityRepository = $this
      ->getContainer()
      ->get('entity.repository');
  }
  return $this->entityRepository;
}