diff --git a/src/Dto/Asset/Archive.php b/src/Dto/Asset/Archive.php index e48d69760..b45fbeb83 100644 --- a/src/Dto/Asset/Archive.php +++ b/src/Dto/Asset/Archive.php @@ -18,6 +18,6 @@ use Pimcore\Bundle\StudioApiBundle\Dto\Asset; -class Archive extends Asset +final class Archive extends Asset { } diff --git a/src/Dto/Asset/Audio.php b/src/Dto/Asset/Audio.php index aa5785219..b03b97945 100644 --- a/src/Dto/Asset/Audio.php +++ b/src/Dto/Asset/Audio.php @@ -18,6 +18,6 @@ use Pimcore\Bundle\StudioApiBundle\Dto\Asset; -class Audio extends Asset +final class Audio extends Asset { } diff --git a/src/Dto/Asset/Document.php b/src/Dto/Asset/Document.php index 26cba5710..6968122d5 100644 --- a/src/Dto/Asset/Document.php +++ b/src/Dto/Asset/Document.php @@ -18,61 +18,30 @@ use Pimcore\Bundle\StudioApiBundle\Dto\Asset; -class Document extends Asset +final class Document extends Asset { //use MetaData\EmbeddedMetaDataTrait; + private ?int $pageCount = null; - public function __construct( - private readonly ?int $pageCount, - private readonly ?string $imageThumbnailPath, - string $iconName, - bool $hasChildren, - string $type, - string $filename, - string $mimeType, - array $metaData, - bool $workflowWithPermissions, - string $fullPath, - int $id, - int $parentId, - string $path, - int $userOwner, - int $userModification, - ?string $locked, - bool $isLocked, - ?int $creationDate, - ?int $modificationDate, - Permissions $permissions - ) { - parent::__construct( - $iconName, - $hasChildren, - $type, - $filename, - $mimeType, - $metaData, - $workflowWithPermissions, - $fullPath, - $id, - $parentId, - $path, - $userOwner, - $userModification, - $locked, - $isLocked, - $creationDate, - $modificationDate, - $permissions - ); - } + private ?string $imageThumbnailPath = null; public function getPageCount(): ?int { return $this->pageCount; } + public function setPageCount(?int $pageCount): void + { + $this->pageCount = $pageCount; + } + public function getImageThumbnailPath(): ?string { return $this->imageThumbnailPath; } + + public function setImageThumbnailPath(?string $imageThumbnailPath): void + { + $this->imageThumbnailPath = $imageThumbnailPath; + } } diff --git a/src/Dto/Asset/Folder.php b/src/Dto/Asset/Folder.php index dd35eb80e..b589522d5 100644 --- a/src/Dto/Asset/Folder.php +++ b/src/Dto/Asset/Folder.php @@ -18,6 +18,6 @@ use Pimcore\Bundle\StudioApiBundle\Dto\Asset; -class Folder extends Asset +final class Folder extends Asset { } diff --git a/src/Dto/Asset/MetaData.php b/src/Dto/Asset/MetaData.php index 9c551e56e..88e1f9195 100644 --- a/src/Dto/Asset/MetaData.php +++ b/src/Dto/Asset/MetaData.php @@ -16,7 +16,7 @@ namespace Pimcore\Bundle\StudioApiBundle\Dto\Asset; -readonly class MetaData +final readonly class MetaData { public function __construct( private string $name, diff --git a/src/Dto/Asset/Permissions.php b/src/Dto/Asset/Permissions.php index f6b370bff..c52218835 100644 --- a/src/Dto/Asset/Permissions.php +++ b/src/Dto/Asset/Permissions.php @@ -16,7 +16,7 @@ namespace Pimcore\Bundle\StudioApiBundle\Dto\Asset; -readonly class Permissions +final readonly class Permissions { //TODO: remove or change default permissions public function __construct( diff --git a/src/Dto/Asset/Text.php b/src/Dto/Asset/Text.php index 5c3e35ef5..2c921bcab 100644 --- a/src/Dto/Asset/Text.php +++ b/src/Dto/Asset/Text.php @@ -18,6 +18,6 @@ use Pimcore\Bundle\StudioApiBundle\Dto\Asset; -class Text extends Asset +final class Text extends Asset { } diff --git a/src/Dto/Asset/Unknown.php b/src/Dto/Asset/Unknown.php index b962864b3..1667b5566 100644 --- a/src/Dto/Asset/Unknown.php +++ b/src/Dto/Asset/Unknown.php @@ -18,6 +18,6 @@ use Pimcore\Bundle\StudioApiBundle\Dto\Asset; -class Unknown extends Asset +final class Unknown extends Asset { } diff --git a/src/Dto/Asset/Video.php b/src/Dto/Asset/Video.php index d4294a4c2..733be14a2 100644 --- a/src/Dto/Asset/Video.php +++ b/src/Dto/Asset/Video.php @@ -18,73 +18,51 @@ use Pimcore\Bundle\StudioApiBundle\Dto\Asset; -class Video extends Asset +final class Video extends Asset { //use MetaData\EmbeddedMetaDataTrait; - - public function __construct( - private readonly ?float $duration, - private readonly ?int $width, - private readonly ?int $height, - private readonly?string $imageThumbnailPath, - string $iconName, - bool $hasChildren, - string $type, - string $filename, - string $mimeType, - array $metaData, - bool $workflowWithPermissions, - string $fullPath, - int $id, - int $parentId, - string $path, - int $userOwner, - int $userModification, - ?string $locked, - bool $isLocked, - ?int $creationDate, - ?int $modificationDate, - Permissions $permissions - ) { - parent::__construct( - $iconName, - $hasChildren, - $type, - $filename, - $mimeType, - $metaData, - $workflowWithPermissions, - $fullPath, - $id, - $parentId, - $path, - $userOwner, - $userModification, - $locked, - $isLocked, - $creationDate, - $modificationDate, - $permissions - ); - } + private ?float $duration; + private ?int $width; + private ?int $height; + private ?string $imageThumbnailPath; public function getDuration(): ?float { return $this->duration; } + public function setDuration(?float $duration): void + { + $this->duration = $duration; + } + public function getWidth(): ?int { return $this->width; } + public function setWidth(?int $width): void + { + $this->width = $width; + } + public function getHeight(): ?int { return $this->height; } + public function setHeight(?int $height): void + { + $this->height = $height; + } + public function getImageThumbnailPath(): ?string { return $this->imageThumbnailPath; } + + public function setImageThumbnailPath(?string $imageThumbnailPath): void + { + $this->imageThumbnailPath = $imageThumbnailPath; + } } diff --git a/src/Service/GenericData/V1/Hydrator/Asset/ArchiveHydrator.php b/src/Service/GenericData/V1/Hydrator/Asset/ArchiveHydrator.php index 6826ee50a..be69e9059 100644 --- a/src/Service/GenericData/V1/Hydrator/Asset/ArchiveHydrator.php +++ b/src/Service/GenericData/V1/Hydrator/Asset/ArchiveHydrator.php @@ -33,24 +33,8 @@ public function __construct( public function hydrate(ArchiveItem $item): Archive { return new Archive( - $this->iconService->getIconForAsset($item->getType(), $item->getMimeType()), - $item->isHasChildren(), - $item->getType(), - $item->getKey(), - $item->getMimeType(), - $this->metaDataHydrator->hydrate($item->getMetaData()), - $item->isHasWorkflowWithPermissions(), - $item->getFullPath(), - $item->getId(), - $item->getParentId(), - $item->getPath(), - $item->getUserOwner(), - $item->getUserModification(), - $item->getLocked(), - $item->isLocked(), - $item->getCreationDate(), - $item->getModificationDate(), - $this->permissionsHydrator->hydrate($item->getPermissions()) + $item->getId() ); + // TODO: Implement hydrate() method. } } diff --git a/src/Service/GenericData/V1/Hydrator/Asset/AudioHydrator.php b/src/Service/GenericData/V1/Hydrator/Asset/AudioHydrator.php index 0148ca078..e4f4b0d07 100644 --- a/src/Service/GenericData/V1/Hydrator/Asset/AudioHydrator.php +++ b/src/Service/GenericData/V1/Hydrator/Asset/AudioHydrator.php @@ -33,24 +33,8 @@ public function __construct( public function hydrate(AudioItem $item): Audio { return new Audio( - $this->iconService->getIconForAsset($item->getType(), $item->getMimeType()), - $item->isHasChildren(), - $item->getType(), - $item->getKey(), - $item->getMimeType(), - $this->metaDataHydrator->hydrate($item->getMetaData()), - $item->isHasWorkflowWithPermissions(), - $item->getFullPath(), - $item->getId(), - $item->getParentId(), - $item->getPath(), - $item->getUserOwner(), - $item->getUserModification(), - $item->getLocked(), - $item->isLocked(), - $item->getCreationDate(), - $item->getModificationDate(), - $this->permissionsHydrator->hydrate($item->getPermissions()) + $item->getId() ); + // TODO: Implement hydrate() method. } } diff --git a/src/Service/GenericData/V1/Hydrator/Asset/FolderHydrator.php b/src/Service/GenericData/V1/Hydrator/Asset/FolderHydrator.php index ca48445e5..8667e4252 100644 --- a/src/Service/GenericData/V1/Hydrator/Asset/FolderHydrator.php +++ b/src/Service/GenericData/V1/Hydrator/Asset/FolderHydrator.php @@ -33,24 +33,8 @@ public function __construct( public function hydrate(FolderItem $item): Folder { return new Folder( - $this->iconService->getIconForAsset($item->getType(), $item->getMimeType()), - $item->isHasChildren(), - $item->getType(), - $item->getKey(), - $item->getMimeType(), - $this->metaDataHydrator->hydrate($item->getMetaData()), - $item->isHasWorkflowWithPermissions(), - $item->getFullPath(), - $item->getId(), - $item->getParentId(), - $item->getPath(), - $item->getUserOwner(), - $item->getUserModification(), - $item->getLocked(), - $item->isLocked(), - $item->getCreationDate(), - $item->getModificationDate(), - $this->permissionsHydrator->hydrate($item->getPermissions()) + $item->getId() ); + // TODO Implement hydrate() method. } } diff --git a/src/Service/GenericData/V1/Hydrator/Asset/TextHydrator.php b/src/Service/GenericData/V1/Hydrator/Asset/TextHydrator.php index b15c8ba64..e09aac6db 100644 --- a/src/Service/GenericData/V1/Hydrator/Asset/TextHydrator.php +++ b/src/Service/GenericData/V1/Hydrator/Asset/TextHydrator.php @@ -33,24 +33,9 @@ public function __construct( public function hydrate(TextItem $item): Text { return new Text( - $this->iconService->getIconForAsset($item->getType(), $item->getMimeType()), - $item->isHasChildren(), - $item->getType(), - $item->getKey(), - $item->getMimeType(), - $this->metaDataHydrator->hydrate($item->getMetaData()), - $item->isHasWorkflowWithPermissions(), - $item->getFullPath(), - $item->getId(), - $item->getParentId(), - $item->getPath(), - $item->getUserOwner(), - $item->getUserModification(), - $item->getLocked(), - $item->isLocked(), - $item->getCreationDate(), - $item->getModificationDate(), - $this->permissionsHydrator->hydrate($item->getPermissions()) + $item->getId() ); + + // TODO: Implement hydrate() method. } } diff --git a/src/Service/GenericData/V1/Hydrator/Asset/UnknownHydrator.php b/src/Service/GenericData/V1/Hydrator/Asset/UnknownHydrator.php index c6decc796..c6773e29d 100644 --- a/src/Service/GenericData/V1/Hydrator/Asset/UnknownHydrator.php +++ b/src/Service/GenericData/V1/Hydrator/Asset/UnknownHydrator.php @@ -33,24 +33,9 @@ public function __construct( public function hydrate(UnknownItem $item): Unknown { return new Unknown( - $this->iconService->getIconForAsset($item->getType(), $item->getMimeType()), - $item->isHasChildren(), - $item->getType(), - $item->getKey(), - $item->getMimeType(), - $this->metaDataHydrator->hydrate($item->getMetaData()), - $item->isHasWorkflowWithPermissions(), - $item->getFullPath(), - $item->getId(), - $item->getParentId(), - $item->getPath(), - $item->getUserOwner(), - $item->getUserModification(), - $item->getLocked(), - $item->isLocked(), - $item->getCreationDate(), - $item->getModificationDate(), - $this->permissionsHydrator->hydrate($item->getPermissions()) + $item->getId() ); + + // TODO: Implement hydrate() method. } } diff --git a/src/Service/ModelData/V1/Hydrator/AssetHydratorServiceInterface.php b/src/Service/ModelData/V1/Hydrator/AssetHydratorServiceInterface.php index 0e0387d7f..3f56ae227 100644 --- a/src/Service/ModelData/V1/Hydrator/AssetHydratorServiceInterface.php +++ b/src/Service/ModelData/V1/Hydrator/AssetHydratorServiceInterface.php @@ -25,13 +25,14 @@ use Pimcore\Bundle\StudioApiBundle\Dto\Asset\Text; use Pimcore\Bundle\StudioApiBundle\Dto\Asset\Unknown; use Pimcore\Bundle\StudioApiBundle\Dto\Asset\Video; +use Pimcore\Model\Asset as ModelAsset; interface AssetHydratorServiceInterface { /** - * @param \Pimcore\Model\Asset + * @param ModelAsset $item * * @return Asset|Archive|Audio|Document|Folder|Image|Text|Unknown|Video */ - public function hydrate(\Pimcore\Model\Asset $item): Asset|Archive|Audio|Document|Folder|Image|Text|Unknown|Video; + public function hydrate(ModelAsset $item): Asset|Archive|Audio|Document|Folder|Image|Text|Unknown|Video; }