You are here

public static function Drupal::cache in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal.php \Drupal::cache()

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

11 calls to Drupal::cache()
DatabaseBackendTagTest::testTagInvalidations in core/modules/system/src/Tests/Cache/DatabaseBackendTagTest.php
DrupalTest::testCache in core/tests/Drupal/Tests/Core/DrupalTest.php
Tests the service() method.
EntityDisplayTest::testEntityDisplayInvalidateCacheTags in core/modules/field_ui/src/Tests/EntityDisplayTest.php
Ensure that entity view display changes invalidates cache tags.
EntityViewBuilderTest::testEntityViewBuilderCache in core/modules/system/src/Tests/Entity/EntityViewBuilderTest.php
Tests entity render cache handling.
FormController::__construct in core/modules/system/tests/modules/condition_test/src/FormController.php
Constructs a \Drupal\condition_test\FormController object.

... See full list

File

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

Class

Drupal
Static Service Container wrapper.

Code

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