public function ParagraphsType::getIconFile

Returns the icon file entity.

Return value

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

Overrides ParagraphsTypeInterface::getIconFile

2 calls to ParagraphsType::getIconFile()
ParagraphsType::calculateDependencies in paragraphs/src/Entity/ParagraphsType.php
ParagraphsType::getIconUrl in paragraphs/src/Entity/ParagraphsType.php
Returns the icon's URL.

File

paragraphs/src/Entity/ParagraphsType.php, line 162

Class

ParagraphsType
Defines the ParagraphsType entity.

Namespace

Drupal\paragraphs\Entity

Code

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