implemented snapshot name parsing

This commit is contained in:
Jonathan Treffler 2025-07-02 14:35:58 +02:00
parent a024d93e02
commit 85d63d5ae2
8 changed files with 175 additions and 36 deletions

View file

@ -5,16 +5,30 @@ namespace OCA\GroupfolderFilesystemSnapshots\Entity;
use JsonSerializable;
class Snapshot implements JsonSerializable {
/** @var string */
private $id;
public function __construct(string $id) {
$this->id = $id;
public function __construct(
private string $id,
private string $name,
private ?\DateTimeImmutable $createdTimestamp = null,
) {
}
public function getId(): string {
return $this->id;
}
public function getName(): string {
return $this->name;
}
public function getCreatedTimestamp(): ?\DateTimeImmutable {
return $this->createdTimestamp;
}
public function jsonSerialize(): mixed {
return [
'id' => $this->id
'id' => $this->id,
'name' => $this->name,
'createdTimestamp' => $this->createdTimestamp?->getTimestamp(),
];
}
}