You are here

class BackgroundImageSettingsCacheContext in Background Image 8

Same name and namespace in other branches
  1. 2.x src/Cache/Context/BackgroundImageSettingsCacheContext.php \Drupal\background_image\Cache\Context\BackgroundImageSettingsCacheContext
  2. 2.0.x src/Cache/Context/BackgroundImageSettingsCacheContext.php \Drupal\background_image\Cache\Context\BackgroundImageSettingsCacheContext

Cache context ID: 'background_image.settings'.

Hierarchy

Expanded class hierarchy of BackgroundImageSettingsCacheContext

1 string reference to 'BackgroundImageSettingsCacheContext'
background_image.services.yml in ./background_image.services.yml
background_image.services.yml
1 service uses BackgroundImageSettingsCacheContext
cache_context.background_image.settings in ./background_image.services.yml
Drupal\background_image\Cache\Context\BackgroundImageSettingsCacheContext

File

src/Cache/Context/BackgroundImageSettingsCacheContext.php, line 8

Namespace

Drupal\background_image\Cache\Context
View source
class BackgroundImageSettingsCacheContext extends BackgroundImageBaseCacheContext {

  /**
   * {@inheritdoc}
   */
  public static function getLabel() {
    return t('Background Image: Settings');
  }

  /**
   * {@inheritdoc}
   */
  public function getContext() {
    return $this->backgroundImage ? $this->backgroundImage
      ->getSettingsHash() : 0;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BackgroundImageBaseCacheContext::$backgroundImage protected property
BackgroundImageBaseCacheContext::$manager protected property
BackgroundImageBaseCacheContext::getCacheableMetadata public function Gets the cacheability metadata for the context. Overrides CacheContextInterface::getCacheableMetadata
BackgroundImageBaseCacheContext::__construct public function Constructs a BackgroundImageCacheContext object.
BackgroundImageSettingsCacheContext::getContext public function Returns the string representation of the cache context. Overrides CacheContextInterface::getContext
BackgroundImageSettingsCacheContext::getLabel public static function Returns the label of the cache context. Overrides CacheContextInterface::getLabel