You are here

protected function Book::prepareImage in Open Social 8

Prepares data about an image of node.

Parameters

string $uuid: The uuid for the image.

Return value

array|null Returns an array or null.

1 call to Book::prepareImage()
Book::getEntry in modules/custom/social_demo/src/Plugin/DemoContent/Book.php
Makes an array with data of an entity.

File

modules/custom/social_demo/src/Plugin/DemoContent/Book.php, line 129

Class

Book
Book Plugin for demo content.

Namespace

Drupal\social_demo\Plugin\DemoContent

Code

protected function prepareImage($uuid) {
  $value = NULL;
  $files = $this->fileStorage
    ->loadByProperties([
    'uuid' => $uuid,
  ]);
  if ($files) {
    $value = [
      [
        'target_id' => current($files)
          ->id(),
      ],
    ];
  }
  return $value;
}