You are here

protected function ParagraphsSet::getFileByUuid in Paragraphs Sets 8.2

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.

2 calls to ParagraphsSet::getFileByUuid()
ParagraphsSet::getIconFile in src/Entity/ParagraphsSet.php
Returns the icon file entity.
ParagraphsSet::postSave in src/Entity/ParagraphsSet.php
Acts on a saved entity before the insert or update hook is invoked.

File

src/Entity/ParagraphsSet.php, line 173

Class

ParagraphsSet
Defines the ParagraphsSet entity.

Namespace

Drupal\paragraphs_sets\Entity

Code

protected function getFileByUuid($uuid) {
  $files = $this
    ->entityTypeManager()
    ->getStorage('file')
    ->loadByProperties([
    'uuid' => $uuid,
  ]);
  if ($files) {
    return current($files);
  }
  return NULL;
}