You are here

protected function Page::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 Page::prepareImage()
Page::getEntry in modules/custom/social_demo/src/Plugin/DemoContent/Page.php
Makes an array with data of an entity.

File

modules/custom/social_demo/src/Plugin/DemoContent/Page.php, line 85

Class

Page
Page 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;
}