19declare(strict_types=1);
48 $this->resource_storage = $resourceStorage;
49 $this->upload_service = $uploadService;
60 int $size = self::IMAGE_SIZE_XS
62 $image_rid = $badge->getImageRid();
63 if ($image_rid ===
null) {
67 $identification = $this->resource_storage->manage()->find($image_rid);
68 if ($identification ===
null) {
72 return $this->resource_storage->consume()->src($identification)->getSrc();
78 $array_result = $this->upload_service->getResults();
79 $array_result = array_pop($array_result);
81 $identification = $this->resource_storage->manage()->upload($array_result, $stakeholder);
85 $this->main_template->setOnScreenMessage(
'failure',
$e->getMessage(),
true);
94 return $this->resource_storage->manage()->clone($identification)->serialize();
ilGlobalTemplateInterface $main_template
getImageFromResourceId(ilBadge $badge, int $size=self::IMAGE_SIZE_XS)
FileUpload $upload_service
cloneBadgeImageByRid(ResourceIdentification $identification)
processImageUpload(ilBadge $badge)
__construct(Services $resourceStorage, FileUpload $uploadService, ilGlobalTemplateInterface $main_template)
Services $resource_storage
getImageFromBadge(ilBadge $badge, int $size=self::IMAGE_SIZE_XS)
Class IllegalStateException.
Class ResourceIdentification.
setImageRid(?string $image_rid)