You are here

public static function CookiesKnockOutService::getInstance in COOKiES Consent Management 1.0.x

Returns instance, if instance does not exist then creates new one.

Return value

$this

File

src/CookiesKnockOutService.php, line 58

Class

CookiesKnockOutService
Class KnockOutService.

Namespace

Drupal\cookies

Code

public static function getInstance() {
  $self = get_called_class();
  if (!isset(self::$instances[$self])) {
    $container = \Drupal::getContainer();
    $entity_type_manager = $container
      ->get('entity_type.manager');
    $theme_manager = $container
      ->get('theme.manager');
    self::$instances[$self] = new $self($entity_type_manager, $theme_manager);
  }
  return self::$instances[$self];
}