added reverted attribute to DiffTaskResult
This commit is contained in:
parent
4870225d66
commit
5b6470a53b
3 changed files with 14 additions and 1 deletions
|
@ -18,6 +18,7 @@ class DiffTaskResult extends Entity implements JsonSerializable {
|
|||
protected $currentFileExists;
|
||||
protected $currentPath;
|
||||
protected $currentSize;
|
||||
protected $reverted;
|
||||
|
||||
public function __construct() {
|
||||
$this->addType('id','integer');
|
||||
|
@ -26,6 +27,7 @@ class DiffTaskResult extends Entity implements JsonSerializable {
|
|||
$this->addType('beforeSize','integer');
|
||||
$this->addType('currentFileExists','boolean');
|
||||
$this->addType('currentSize','integer');
|
||||
$this->addType('reverted','boolean');
|
||||
}
|
||||
|
||||
public function jsonSerialize() {
|
||||
|
@ -42,7 +44,8 @@ class DiffTaskResult extends Entity implements JsonSerializable {
|
|||
'fileExists' => $this->currentFileExists,
|
||||
'path' => $this->currentPath,
|
||||
'size' => $this->currentSize,
|
||||
]
|
||||
],
|
||||
'reverted' => $this->reverted,
|
||||
];
|
||||
}
|
||||
}
|
|
@ -33,4 +33,10 @@ class DiffTaskResultMapper extends QBMapper {
|
|||
return $this->findEntities($qb);
|
||||
}
|
||||
|
||||
public function markReverted(int $id) {
|
||||
$taskResult = $this->find($id);
|
||||
$taskResult->setReverted(True);
|
||||
return $this->update($taskResult);
|
||||
}
|
||||
|
||||
}
|
|
@ -94,6 +94,10 @@
|
|||
'default' => 0
|
||||
]);
|
||||
|
||||
$table->addColumn('reverted', 'boolean', [
|
||||
'default' => false,
|
||||
]);
|
||||
|
||||
$table->setPrimaryKey(['id']);
|
||||
$table->addIndex(['task_id'], 'taskid_index');
|
||||
$table->addForeignKeyConstraint($schema->getTable(self::TASKS_TABLE), ['task_id'], ['id'], ['onDelete' => 'CASCADE'], 'results_taskid_fk');
|
||||
|
|
Loading…
Reference in a new issue