public function BackgroundImage::getImageFile in Background Image 8
Same name and namespace in other branches
- 2.x src/Entity/BackgroundImage.php \Drupal\background_image\Entity\BackgroundImage::getImageFile()
- 2.0.x src/Entity/BackgroundImage.php \Drupal\background_image\Entity\BackgroundImage::getImageFile()
Retrieves the image file.
Parameters
bool $parents: Flag indicating whether to use parent image if this image is not set.
Return value
\Drupal\file\FileInterface|null The image File object or NULL if it doesn't exist.
Overrides BackgroundImageInterface::getImageFile
1 call to BackgroundImage::getImageFile()
- BackgroundImage::getImageHash in src/
Entity/ BackgroundImage.php - Retrieves the image based hash.
File
- src/
Entity/ BackgroundImage.php, line 351
Class
- BackgroundImage
- Defines the Background Image entity.
Namespace
Drupal\background_image\EntityCode
public function getImageFile($parents = TRUE) {
$file = $this
->get('image')->entity;
if (!$file && $parents && ($parent = $this
->getParent())) {
$file = $parent
->getImageFile($parents);
}
return $file;
}