You are here

public function BackgroundImageManager::validView in Background Image 8

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

Checks whether a view can use background images.

Parameters

\Drupal\views\ViewEntityInterface $view: An ViewEntityInterface object.

Return value

bool TRUE or FALSE

Overrides BackgroundImageManagerInterface::validView

1 call to BackgroundImageManager::validView()
BackgroundImageManager::getViewBackgroundImage in src/BackgroundImageManager.php
Retrieves the bundle info for a given entity type.

File

src/BackgroundImageManager.php, line 736

Class

BackgroundImageManager

Namespace

Drupal\background_image

Code

public function validView(ViewEntityInterface $view) {

  // Check enabled entity bundles.
  if (!in_array("{$view->id()}:{$view->getExecutable()->current_display}", array_keys($this
    ->getViewsPages()))) {
    return FALSE;
  }
  return TRUE;
}