function ConfigOverrideIntegrationTestCacheContext::getContext

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

Overrides CacheContextInterface::getContext

File

core/modules/config/tests/config_override_integration_test/src/Cache/ConfigOverrideIntegrationTestCacheContext.php, line 25

Class

ConfigOverrideIntegrationTestCacheContext
A cache context service intended for the config override integration test.

Namespace

Drupal\config_override_integration_test\Cache

Code

public function getContext() {
    // Default to the 'disabled' state.
    $state = \Drupal::state()->get('config_override_integration_test.enabled', FALSE) ? 'yes' : 'no';
    return 'config_override_integration_test.' . $state;
}

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