You are here

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

File

modules/custom/social_demo/src/Plugin/DemoContent/Event.php, line 123

Class

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