Cache::getBins

public static Cache::getBins()

Gets all cache bin services.

Return value

\Drupal\Core\Cache\CacheBackendInterface[] An array of cache backend objects keyed by cache bins.

File

core/lib/Drupal/Core/Cache/Cache.php, line 154

Class

Cache
Helper methods for cache.

Namespace

Drupal\Core\Cache

Code

public static function getBins() {
  $bins = array();
  $container = \Drupal::getContainer();
  foreach ($container->getParameter('cache_bins') as $service_id => $bin) {
    $bins[$bin] = $container->get($service_id);
  }
  return $bins;
}
doc_Drupal
2016-10-29 08:49:09
Comments
Leave a Comment

Please login to continue.