Skip to content

Commit

Permalink
feat: Added document Dto width, height and mimeType
Browse files Browse the repository at this point in the history
  • Loading branch information
ambroisemaupate committed Mar 2, 2022
1 parent 218bbd1 commit 62958a3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Api/DataTransformer/DocumentOutputDataTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ public function transform($data, string $to, array $context = []): object
$output->relativePath = $data->getRelativePath();
$output->processable = $data->isProcessable();
$output->type = $data->getShortType();
$output->imageWidth = $data->getImageWidth();
$output->imageHeight = $data->getImageHeight();
$output->mimeType = $data->getMimeType();
$output->alt = $data->getFilename();
$output->embedId = $data->getEmbedId();
$output->embedPlatform = $data->getEmbedPlatform();
Expand Down
15 changes: 15 additions & 0 deletions src/Api/Dto/DocumentOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ final class DocumentOutput
* @Groups({"document", "document_display"})
*/
public string $type = '';
/**
* @var string
* @Groups({"document", "document_display"})
*/
public string $mimeType = '';
/**
* @var string|null
* @Groups({"document", "document_display"})
Expand All @@ -45,6 +50,16 @@ final class DocumentOutput
* @Groups({"document", "document_display"})
*/
public ?string $imageAverageColor = null;
/**
* @var int|null
* @Groups({"document", "document_display"})
*/
public ?int $imageWidth = null;
/**
* @var int|null
* @Groups({"document", "document_display"})
*/
public ?int $imageHeight = null;
/**
* @var string|null
* @Groups({"document", "document_display"})
Expand Down

0 comments on commit 62958a3

Please sign in to comment.