protected function FormEntityHelperTrait::getEntityRepository in Block Style Plugins 8.2
Gets the Entity Repository service.
Return value
\Drupal\Core\Entity\EntityRepositoryInterface The Entity Repository service.
File
- src/
FormEntityHelperTrait.php, line 28
Class
- FormEntityHelperTrait
- Provides a helper for getting information from the entity being styled.
Namespace
Drupal\block_style_pluginsCode
protected function getEntityRepository() {
if (!$this->entityRepository) {
$this->entityRepository = \Drupal::service('entity.repository');
}
return $this->entityRepository;
}