You are here

protected function DemoUser::preparePicture in Open Social 8

Prepares data about an image of a profile.

Parameters

string $picture: The picture by uuid.

Return value

array Returns an array.

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

File

modules/custom/social_demo/src/DemoUser.php, line 173

Class

DemoUser
Class DemoUser.

Namespace

Drupal\social_demo

Code

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