protected function Topic::prepareImage in Open Social 8
Prepares data about an image of node.
Parameters
string $uuid: Type of uuid.
Return value
array|null Returns array|null
1 call to Topic::prepareImage()
- Topic::getEntry in modules/
custom/ social_demo/ src/ Plugin/ DemoContent/ Topic.php - Makes an array with data of an entity.
File
- modules/
custom/ social_demo/ src/ Plugin/ DemoContent/ Topic.php, line 99
Class
- Topic
- Topic Plugin for demo content.
Namespace
Drupal\social_demo\Plugin\DemoContentCode
protected function prepareImage($uuid) {
$value = NULL;
$files = $this->fileStorage
->loadByProperties([
'uuid' => $uuid,
]);
if ($files) {
$value = [
[
'target_id' => current($files)
->id(),
],
];
}
return $value;
}