Skip to content

Commit

Permalink
[Grid] Add Owner and Modification Date (#424)
Browse files Browse the repository at this point in the history
* Initial Commit.

* Add owner.
  • Loading branch information
martineiber authored Sep 17, 2024
1 parent 96a52a2 commit e8718f4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/Grid/Hydrator/DetailedConfigurationHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public function hydrate(
array $roles,
bool $isFavorite
): DetailedConfiguration {

return new DetailedConfiguration(
name: $data->getName(),
description: $data->getDescription(),
Expand All @@ -40,7 +41,10 @@ public function hydrate(
sharedRoles: $roles,
columns: $data->getColumns(),
filter: $data->getFilter() ?? [],
pageSize: $data->getPageSize()
pageSize: $data->getPageSize(),
modificationDate: $data->getModificationDate()->getTimestamp(),
creationDate: $data->getCreationDate()->getTimestamp(),
ownerId: $data->getOwner()
);
}
}
20 changes: 19 additions & 1 deletion src/Grid/Schema/DetailedConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ public function __construct(
#[Property(description: 'filter', type: 'array', items: new Items(ref: Filter::class))]
private readonly array $filter,
#[Property(description: 'Page Size', type: 'integer', example: 42)]
private readonly int $pageSize = 25
private readonly int $pageSize = 25,
private readonly ?int $modificationDate = null,
private readonly ?int $creationDate = null,
private readonly ?int $ownerId = null,
) {
}

Expand Down Expand Up @@ -122,4 +125,19 @@ public function getPageSize(): int
{
return $this->pageSize;
}

public function getModificationDate(): ?int
{
return $this->modificationDate;
}

public function getCreationDate(): ?int
{
return $this->creationDate;
}

public function getOwnerId(): ?int
{
return $this->ownerId;
}
}

0 comments on commit e8718f4

Please sign in to comment.