You are here

public function UpdateCacheSubscriber::__construct in Custom Contextual Links 8.2

UpdateCacheSubscriber constructor.

Parameters

\Drupal\Core\Entity\EntityTypeManager $entity_manager: Inject EntityTypeManager.

\Drupal\Core\Cache\CacheBackendInterface $cache_backend: Inject CacheBackend service.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

File

src/EventSubscriber/UpdateCacheSubscriber.php, line 46

Class

UpdateCacheSubscriber
Class EventSubscriber.

Namespace

Drupal\ccl\EventSubscriber

Code

public function __construct(EntityTypeManager $entity_manager, CacheBackendInterface $cache_backend) {
  $this->entityStorage = $entity_manager
    ->getStorage('custom_contextual_link');
  $this->cache = $cache_backend;
  $this->linkType = 'node';
}