You are here

public function BackgroundImageManager::getFallbackImageStyle in Background Image 8

Same name and namespace in other branches
  1. 2.x src/BackgroundImageManager.php \Drupal\background_image\BackgroundImageManager::getFallbackImageStyle()
  2. 2.0.x src/BackgroundImageManager.php \Drupal\background_image\BackgroundImageManager::getFallbackImageStyle()

Retrieves the fallback image style.

Return value

string

Overrides BackgroundImageManagerInterface::getFallbackImageStyle

File

src/BackgroundImageManager.php, line 579

Class

BackgroundImageManager

Namespace

Drupal\background_image

Code

public function getFallbackImageStyle() {
  $image_style = $this->config
    ->get('image_style.fallback') ?: 'background_image_lg';
  if ($responsive_image_style = $this
    ->getResponsiveImageStyle()) {
    return $responsive_image_style
      ->getFallbackImageStyle() ?: $image_style;
  }
  return $image_style;
}