You are here

public function ParagraphsType::getIconFile in Paragraphs 8

Returns the icon file entity.

Return value

\Drupal\file\FileInterface|bool The icon's file entity or FALSE if icon does not exist.

Overrides ParagraphsTypeInterface::getIconFile

2 calls to ParagraphsType::getIconFile()
ParagraphsType::calculateDependencies in src/Entity/ParagraphsType.php
Calculates dependencies and stores them in the dependency property.
ParagraphsType::getIconUrl in src/Entity/ParagraphsType.php
Returns the icon's URL.

File

src/Entity/ParagraphsType.php, line 161

Class

ParagraphsType
Defines the ParagraphsType entity.

Namespace

Drupal\paragraphs\Entity

Code

public function getIconFile() {
  $icon = $this
    ->getFileByUuid($this->icon_uuid) ?: $this
    ->restoreDefaultIcon();
  if ($this->icon_uuid && $icon) {
    return $icon;
  }
  return FALSE;
}