2023-09-02 02:41:53 +02:00
|
|
|
<?php
|
|
|
|
namespace OCA\GroupfolderFilesystemSnapshots\Db;
|
|
|
|
|
|
|
|
use JsonSerializable;
|
|
|
|
|
|
|
|
use OCP\AppFramework\Db\Entity;
|
|
|
|
|
|
|
|
class DiffTaskResult extends Entity implements JsonSerializable {
|
|
|
|
|
|
|
|
protected $taskId;
|
|
|
|
protected $timestamp;
|
|
|
|
protected $type;
|
|
|
|
|
|
|
|
protected $beforeFileExists;
|
|
|
|
protected $beforePath;
|
|
|
|
protected $beforeSize;
|
|
|
|
|
|
|
|
protected $currentFileExists;
|
|
|
|
protected $currentPath;
|
|
|
|
protected $currentSize;
|
2024-01-24 20:22:02 +01:00
|
|
|
protected $reverted;
|
2023-09-02 02:41:53 +02:00
|
|
|
|
|
|
|
public function __construct() {
|
|
|
|
$this->addType('id','integer');
|
|
|
|
$this->addType('taskId','integer');
|
|
|
|
$this->addType('beforeFileExists','boolean');
|
|
|
|
$this->addType('beforeSize','integer');
|
|
|
|
$this->addType('currentFileExists','boolean');
|
|
|
|
$this->addType('currentSize','integer');
|
2024-01-24 20:22:02 +01:00
|
|
|
$this->addType('reverted','boolean');
|
2023-09-02 02:41:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function jsonSerialize() {
|
|
|
|
return [
|
|
|
|
'id' => $this->id,
|
|
|
|
'taskId' => $this->taskId,
|
|
|
|
'type' => $this->type,
|
|
|
|
'before' => [
|
|
|
|
'fileExists' => $this->beforeFileExists,
|
|
|
|
'path' => $this->beforePath,
|
|
|
|
'size' => $this->beforeSize,
|
|
|
|
],
|
|
|
|
'current' => [
|
|
|
|
'fileExists' => $this->currentFileExists,
|
|
|
|
'path' => $this->currentPath,
|
|
|
|
'size' => $this->currentSize,
|
2024-01-24 20:22:02 +01:00
|
|
|
],
|
|
|
|
'reverted' => $this->reverted,
|
2023-09-02 02:41:53 +02:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|