protected function ParagraphsType::getFileByUuid

Gets the file entity defined by the UUID.

Parameters

string $uuid: The file entity's UUID.

Return value

\Drupal\file\FileInterface|null The file entity. NULL if the UUID is invalid.

3 calls to ParagraphsType::getFileByUuid()
ParagraphsType::getIconFile in paragraphs/src/Entity/ParagraphsType.php
Returns the icon file entity.
ParagraphsType::postSave in paragraphs/src/Entity/ParagraphsType.php
ParagraphsType::restoreDefaultIcon in paragraphs/src/Entity/ParagraphsType.php
Restores the icon file from the default icon value.

File

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

Class

ParagraphsType
Defines the ParagraphsType entity.

Namespace

Drupal\paragraphs\Entity

Code

protected function getFileByUuid($uuid) {
  if ($id = \Drupal::service('paragraphs_type.uuid_lookup')
    ->get($uuid)) {
    return $this
      ->entityTypeManager()
      ->getStorage('file')
      ->load($id);
  }
  return NULL;
}