You are here

public function BackgroundImage::getCssClass in Background Image 2.0.x

Same name and namespace in other branches
  1. 8 src/Entity/BackgroundImage.php \Drupal\background_image\Entity\BackgroundImage::getCssClass()
  2. 2.x src/Entity/BackgroundImage.php \Drupal\background_image\Entity\BackgroundImage::getCssClass()

Return value

string

Overrides BackgroundImageInterface::getCssClass

File

src/Entity/BackgroundImage.php, line 306

Class

BackgroundImage
Defines the Background Image entity.

Namespace

Drupal\background_image\Entity

Code

public function getCssClass() {
  if (!isset($this->cssSelector)) {
    $this->cssSelector = $this
      ->getBackgroundImageManager()
      ->getBaseClass() . '--' . Html::cleanCssIdentifier($this
      ->getImageHash());
  }
  return $this->cssSelector;
}