You are here

protected function DemoGroup::prepareImage in Open Social 8

Prepares data about an image of a group.

Parameters

string $image: The uuid of the image.

Return value

array Returns an array.

1 call to DemoGroup::prepareImage()
DemoGroup::createContent in modules/custom/social_demo/src/DemoGroup.php
Creates content.

File

modules/custom/social_demo/src/DemoGroup.php, line 211

Class

DemoGroup
Class DemoGroup.

Namespace

Drupal\social_demo

Code

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