8.5.x Drupal.php Drupal::cache($bin = 'default')
8.0.x Drupal.php Drupal::cache($bin = 'default')
8.1.x Drupal.php Drupal::cache($bin = 'default')
8.2.x Drupal.php Drupal::cache($bin = 'default')
8.3.x Drupal.php Drupal::cache($bin = 'default')
8.4.x Drupal.php Drupal::cache($bin = 'default')
8.6.x Drupal.php Drupal::cache($bin = 'default')

Returns the requested cache bin.

Parameters

string $bin: (optional) The cache bin for which the cache object should be returned, defaults to 'default'.

Return value

\Drupal\Core\Cache\CacheBackendInterface The cache object associated with the specified bin.

Related topics

File

core/lib/Drupal.php, line 308
Contains \Drupal.

Class

Drupal
Static Service Container wrapper.

Code

public static function cache($bin = 'default') {
  return static::getContainer()
    ->get('cache.' . $bin);
}