nextcloud_groupfolder_files.../lib/Entity/Snapshot.php

34 lines
679 B
PHP

<?php
namespace OCA\GroupfolderFilesystemSnapshots\Entity;
use JsonSerializable;
class Snapshot implements JsonSerializable {
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,
'name' => $this->name,
'createdTimestamp' => $this->createdTimestamp?->getTimestamp(),
];
}
}