implemented snapshot name parsing
This commit is contained in:
parent
a024d93e02
commit
85d63d5ae2
8 changed files with 175 additions and 36 deletions
|
@ -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(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue