You are here

protected function CookiesConfigService::getServiceGroups in COOKiES Consent Management 1.0.x

Lazy loader for service groups.

Return value

array|\Drupal\Core\Entity\EntityInterface[] Service groups.

1 call to CookiesConfigService::getServiceGroups()
CookiesConfigService::getGroup in src/Services/CookiesConfigService.php
Returns a single cookie_service_group entity by ID.

File

src/Services/CookiesConfigService.php, line 251

Class

CookiesConfigService
Services to handle module config and method for a rendered documentation.

Namespace

Drupal\cookies\Services

Code

protected function getServiceGroups() {
  if (!$this->serviceGroups) {
    try {
      $this->serviceGroups = $this->entityTypeManager
        ->getStorage('cookies_service_group')
        ->loadMultiple();
    } catch (\Exception $exception) {

      // @codingStandardsIgnoreStart
      // Disabled PHPCS warning because this is just an exception.
      \Drupal::logger('cookies')
        ->error($exception
        ->getMessage());

      // @codingStandardsIgnoreEnd
    }
  }
  return $this->serviceGroups;
}