Skip to content

Commit

Permalink
add children sort information to the data object model
Browse files Browse the repository at this point in the history
  • Loading branch information
lukmzig committed Jan 15, 2025
1 parent 1c0b2c3 commit dbdbeb3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/DataIndex/Hydrator/DataObject/FolderHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
2 changes: 2 additions & 0 deletions src/DataIndex/Hydrator/DataObjectHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
14 changes: 14 additions & 0 deletions src/DataObject/Schema/DataObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit dbdbeb3

Please sign in to comment.