function PirateDayCacheContext::isPirateDay
Returns whether or not it is Pirate Day.
To ease testing this is determined with a global variable rather than using the traditional compass and sextant.
Return value
bool Returns TRUE if it is Pirate Day today.
2 calls to PirateDayCacheContext::isPirateDay()
- PirateDayCacheabilityMetadataConfigOverride::loadOverrides in core/
modules/ config/ tests/ config_override_test/ src/ PirateDayCacheabilityMetadataConfigOverride.php  - Returns config overrides.
 - PirateDayCacheContext::getContext in core/
modules/ config/ tests/ config_override_test/ src/ Cache/ PirateDayCacheContext.php  - Returns the string representation of the cache context.
 
File
- 
              core/
modules/ config/ tests/ config_override_test/ src/ Cache/ PirateDayCacheContext.php, line 50  
Class
- PirateDayCacheContext
 - Defines the PirateDayCacheContext service that allows to cache the booty.
 
Namespace
Drupal\config_override_test\CacheCode
public static function isPirateDay() {
  return !empty($GLOBALS['it_is_pirate_day']);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.