You are here

public static function PirateDayCacheContext::isPirateDay in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/config/tests/config_override_test/src/Cache/PirateDayCacheContext.php \Drupal\config_override_test\Cache\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 55
Contains \Drupal\config_override_test\Cache\PirateDayCacheContext.

Class

PirateDayCacheContext
Defines the PirateDayCacheContext service that allows to cache the booty.

Namespace

Drupal\config_override_test\Cache

Code

public static function isPirateDay() {
  return !empty($GLOBALS['it_is_pirate_day']);
}