function TimeZoneCacheContext::getContext
Same name in other branches
- 9 core/lib/Drupal/Core/Cache/Context/TimeZoneCacheContext.php \Drupal\Core\Cache\Context\TimeZoneCacheContext::getContext()
- 8.9.x core/lib/Drupal/Core/Cache/Context/TimeZoneCacheContext.php \Drupal\Core\Cache\Context\TimeZoneCacheContext::getContext()
- 10 core/lib/Drupal/Core/Cache/Context/TimeZoneCacheContext.php \Drupal\Core\Cache\Context\TimeZoneCacheContext::getContext()
Overrides CacheContextInterface::getContext
File
-
core/
lib/ Drupal/ Core/ Cache/ Context/ TimeZoneCacheContext.php, line 26
Class
- TimeZoneCacheContext
- Defines the TimeZoneCacheContext service, for "per time zone" caching.
Namespace
Drupal\Core\Cache\ContextCode
public function getContext() {
// date_default_timezone_set() is called in AccountProxy::setAccount(), so
// we can safely retrieve the timezone.
return date_default_timezone_get();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.