diff --git a/src/DataIndex/Hydrator/DataObject/FolderHydrator.php b/src/DataIndex/Hydrator/DataObject/FolderHydrator.php index 2c9da3a5..10d8732d 100644 --- a/src/DataIndex/Hydrator/DataObject/FolderHydrator.php +++ b/src/DataIndex/Hydrator/DataObject/FolderHydrator.php @@ -40,6 +40,8 @@ public function hydrate(Folder $item): DataObjectFolder $item->getFullPath(), $this->permissionsHydrator->hydrate($item->getPermissions()), $item->getIndex(), + $item->getChildrenSortBy(), + $item->getChildrenSortOrder(), $item->getId(), $item->getParentId(), $item->getPath(), diff --git a/src/DataIndex/Hydrator/DataObjectHydrator.php b/src/DataIndex/Hydrator/DataObjectHydrator.php index 412b306c..3ac4bcfd 100644 --- a/src/DataIndex/Hydrator/DataObjectHydrator.php +++ b/src/DataIndex/Hydrator/DataObjectHydrator.php @@ -41,6 +41,8 @@ public function hydrate(DataObjectSearchResultItem $dataObject): DataObject $dataObject->getFullPath(), $this->permissionsHydrator->hydrate($dataObject->getPermissions()), $dataObject->getIndex(), + $dataObject->getChildrenSortBy(), + $dataObject->getChildrenSortOrder(), $dataObject->getId(), $dataObject->getParentId(), $dataObject->getPath(), diff --git a/src/DataObject/Schema/DataObject.php b/src/DataObject/Schema/DataObject.php index ff9d2b37..f906ddea 100644 --- a/src/DataObject/Schema/DataObject.php +++ b/src/DataObject/Schema/DataObject.php @@ -75,6 +75,10 @@ public function __construct( private readonly DataObjectPermissions $permissions, #[Property(description: 'Custom index', type: 'integer', example: 0)] private readonly int $index, + #[Property(description: 'Sort mode of children', type: 'string', example: 'index')] + private readonly string $childrenSortBy, + #[Property(description: 'Sort order of children', type: 'string', example: 'asc')] + private readonly string $childrenSortOrder, int $id, int $parentId, string $path, @@ -153,6 +157,16 @@ public function getIndex(): int return $this->index; } + public function getChildrenSortBy(): string + { + return $this->childrenSortBy; + } + + public function getChildrenSortOrder(): string + { + return $this->childrenSortOrder; + } + public function setObjectData(array $objectData): void { $this->objectData = $objectData;