function ViewsTestCacheContext::getContext

Same name in other branches
  1. 9 core/modules/views/tests/modules/views_test_data/src/Cache/ViewsTestCacheContext.php \Drupal\views_test_data\Cache\ViewsTestCacheContext::getContext()
  2. 8.9.x core/modules/views/tests/modules/views_test_data/src/Cache/ViewsTestCacheContext.php \Drupal\views_test_data\Cache\ViewsTestCacheContext::getContext()
  3. 11.x core/modules/views/tests/modules/views_test_data/src/Cache/ViewsTestCacheContext.php \Drupal\views_test_data\Cache\ViewsTestCacheContext::getContext()

Overrides CacheContextInterface::getContext

File

core/modules/views/tests/modules/views_test_data/src/Cache/ViewsTestCacheContext.php, line 25

Class

ViewsTestCacheContext
Test cache context which uses a dynamic context coming from state.

Namespace

Drupal\views_test_data\Cache

Code

public function getContext() {
    return \Drupal::state()->get('views_test_cache_context', 'George');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.