class EventAnEnrollCacheContext in Open Social 10.0.x
Same name and namespace in other branches
- 8.9 modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollCacheContext.php \Drupal\social_event_an_enroll\EventAnEnrollCacheContext
- 8.8 modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollCacheContext.php \Drupal\social_event_an_enroll\EventAnEnrollCacheContext
- 10.3.x modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollCacheContext.php \Drupal\social_event_an_enroll\EventAnEnrollCacheContext
- 10.1.x modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollCacheContext.php \Drupal\social_event_an_enroll\EventAnEnrollCacheContext
- 10.2.x modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollCacheContext.php \Drupal\social_event_an_enroll\EventAnEnrollCacheContext
Defines a class for a anonymous event enrollment route context.
Hierarchy
- class \Drupal\social_event_an_enroll\EventAnEnrollCacheContext implements CacheContextInterface
Expanded class hierarchy of EventAnEnrollCacheContext
1 string reference to 'EventAnEnrollCacheContext'
- social_event_an_enroll.services.yml in modules/
social_features/ social_event/ modules/ social_event_an_enroll/ social_event_an_enroll.services.yml - modules/social_features/social_event/modules/social_event_an_enroll/social_event_an_enroll.services.yml
1 service uses EventAnEnrollCacheContext
- cache_context.event_an_enroll_route in modules/
social_features/ social_event/ modules/ social_event_an_enroll/ social_event_an_enroll.services.yml - Drupal\social_event_an_enroll\EventAnEnrollCacheContext
File
- modules/
social_features/ social_event/ modules/ social_event_an_enroll/ src/ EventAnEnrollCacheContext.php, line 12
Namespace
Drupal\social_event_an_enrollView source
class EventAnEnrollCacheContext implements CacheContextInterface {
/**
* Route match.
*
* @var \Drupal\Core\Routing\RouteMatchInterface
*/
protected $routeMatch;
/**
* Constructs a new PreviewLinkCacheContext.
*
* @param \Drupal\Core\Routing\RouteMatchInterface $routeMatch
* Route match.
*/
public function __construct(RouteMatchInterface $routeMatch) {
$this->routeMatch = $routeMatch;
}
/**
* {@inheritdoc}
*/
public static function getLabel() {
return 'Is AN enrollment route';
}
/**
* {@inheritdoc}
*/
public function getContext() {
return ($route = $this->routeMatch
->getRouteObject()) && $route
->getOption('_event_an_enroll_route') ?: FALSE;
}
/**
* {@inheritdoc}
*/
public function getCacheableMetadata() {
return (new CacheableMetadata())
->addCacheTags([
'routes',
]);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EventAnEnrollCacheContext:: |
protected | property | Route match. | |
EventAnEnrollCacheContext:: |
public | function |
Gets the cacheability metadata for the context. Overrides CacheContextInterface:: |
|
EventAnEnrollCacheContext:: |
public | function |
Returns the string representation of the cache context. Overrides CacheContextInterface:: |
|
EventAnEnrollCacheContext:: |
public static | function |
Returns the label of the cache context. Overrides CacheContextInterface:: |
|
EventAnEnrollCacheContext:: |
public | function | Constructs a new PreviewLinkCacheContext. |