class BackgroundImageCacheContext in Background Image 8
Same name and namespace in other branches
- 2.x src/Cache/Context/BackgroundImageCacheContext.php \Drupal\background_image\Cache\Context\BackgroundImageCacheContext
- 2.0.x src/Cache/Context/BackgroundImageCacheContext.php \Drupal\background_image\Cache\Context\BackgroundImageCacheContext
Cache context ID: 'background_image'.
Hierarchy
- class \Drupal\background_image\Cache\Context\BackgroundImageBaseCacheContext implements CacheContextInterface
- class \Drupal\background_image\Cache\Context\BackgroundImageCacheContext
Expanded class hierarchy of BackgroundImageCacheContext
1 string reference to 'BackgroundImageCacheContext'
1 service uses BackgroundImageCacheContext
File
- src/
Cache/ Context/ BackgroundImageCacheContext.php, line 8
Namespace
Drupal\background_image\Cache\ContextView source
class BackgroundImageCacheContext extends BackgroundImageBaseCacheContext {
/**
* {@inheritdoc}
*/
public static function getLabel() {
return t('Background Image');
}
/**
* {@inheritdoc}
*/
public function getContext() {
return $this->backgroundImage ? $this->backgroundImage
->getImageHash() : 0;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BackgroundImageBaseCacheContext:: |
protected | property | ||
BackgroundImageBaseCacheContext:: |
protected | property | ||
BackgroundImageBaseCacheContext:: |
public | function |
Gets the cacheability metadata for the context. Overrides CacheContextInterface:: |
|
BackgroundImageBaseCacheContext:: |
public | function | Constructs a BackgroundImageCacheContext object. | |
BackgroundImageCacheContext:: |
public | function |
Returns the string representation of the cache context. Overrides CacheContextInterface:: |
|
BackgroundImageCacheContext:: |
public static | function |
Returns the label of the cache context. Overrides CacheContextInterface:: |