You are here

BackgroundImageCacheContext.php in Background Image 2.0.x

File

src/Cache/Context/BackgroundImageCacheContext.php
View source
<?php

namespace Drupal\background_image\Cache\Context;


/**
 * Cache context ID: 'background_image'.
 */
class BackgroundImageCacheContext extends BackgroundImageBaseCacheContext {

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

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

}

Classes

Namesort descending Description
BackgroundImageCacheContext Cache context ID: 'background_image'.