You are here

public function EventAnEnrollCacheContext::getContext in Open Social 8.8

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollCacheContext.php \Drupal\social_event_an_enroll\EventAnEnrollCacheContext::getContext()
  2. 10.3.x modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollCacheContext.php \Drupal\social_event_an_enroll\EventAnEnrollCacheContext::getContext()
  3. 10.0.x modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollCacheContext.php \Drupal\social_event_an_enroll\EventAnEnrollCacheContext::getContext()
  4. 10.1.x modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollCacheContext.php \Drupal\social_event_an_enroll\EventAnEnrollCacheContext::getContext()
  5. 10.2.x modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollCacheContext.php \Drupal\social_event_an_enroll\EventAnEnrollCacheContext::getContext()

Returns the string representation of the cache context.

A cache context service's name is used as a token (placeholder) cache key, and is then replaced with the string returned by this method.

Return value

string The string representation of the cache context.

Overrides CacheContextInterface::getContext

File

modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollCacheContext.php, line 41

Class

EventAnEnrollCacheContext
Defines a class for a anonymous event enrollment route context.

Namespace

Drupal\social_event_an_enroll

Code

public function getContext() {
  return ($route = $this->routeMatch
    ->getRouteObject()) && $route
    ->getOption('_event_an_enroll_route') ?: FALSE;
}