You are here

protected function CacheTagsInvalidator::getInvalidatorCacheBins in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Cache/CacheTagsInvalidator.php \Drupal\Core\Cache\CacheTagsInvalidator::getInvalidatorCacheBins()

Returns all cache bins that need to be notified about invalidations.

Return value

\Drupal\Core\Cache\CacheTagsInvalidatorInterface[] An array of cache backend objects that implement the invalidator interface, keyed by their cache bin.

1 call to CacheTagsInvalidator::getInvalidatorCacheBins()
CacheTagsInvalidator::invalidateTags in core/lib/Drupal/Core/Cache/CacheTagsInvalidator.php
Marks cache items with any of the specified tags as invalid.

File

core/lib/Drupal/Core/Cache/CacheTagsInvalidator.php, line 69

Class

CacheTagsInvalidator
Passes cache tag events to classes that wish to respond to them.

Namespace

Drupal\Core\Cache

Code

protected function getInvalidatorCacheBins() {
  $bins = [];
  foreach ($this->container
    ->getParameter('cache_bins') as $service_id => $bin) {
    $service = $this->container
      ->get($service_id);
    if ($service instanceof CacheTagsInvalidatorInterface) {
      $bins[$bin] = $service;
    }
  }
  return $bins;
}