fixed more indentations
This commit is contained in:
parent
acf8990de1
commit
f031591753
9 changed files with 148 additions and 148 deletions
|
@ -7,25 +7,25 @@ use OCP\AppFramework\Db\Entity;
|
|||
|
||||
class DiffTask extends Entity implements JsonSerializable {
|
||||
|
||||
protected $userId;
|
||||
protected $groupfolderId;
|
||||
protected $userId;
|
||||
protected $groupfolderId;
|
||||
protected $relativePath;
|
||||
protected $snapshotId;
|
||||
protected $timestamp;
|
||||
protected $snapshotId;
|
||||
protected $timestamp;
|
||||
|
||||
public function __construct() {
|
||||
$this->addType('id','integer');
|
||||
$this->addType('groupfolderId','integer');
|
||||
}
|
||||
public function __construct() {
|
||||
$this->addType('id','integer');
|
||||
$this->addType('groupfolderId','integer');
|
||||
}
|
||||
|
||||
public function jsonSerialize() {
|
||||
return [
|
||||
'id' => $this->id,
|
||||
public function jsonSerialize() {
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'userId' => $this->userId,
|
||||
'groupfolderId' => $this->groupfolderId,
|
||||
'groupfolderId' => $this->groupfolderId,
|
||||
'relativePath' => $this->relativePath,
|
||||
'snapshotId' => $this->snapshotId,
|
||||
'timestamp' => $this->timestamp,
|
||||
];
|
||||
}
|
||||
'snapshotId' => $this->snapshotId,
|
||||
'timestamp' => $this->timestamp,
|
||||
];
|
||||
}
|
||||
}
|
|
@ -9,29 +9,29 @@ use OCP\AppFramework\Db\QBMapper;
|
|||
*/
|
||||
class DiffTaskMapper extends QBMapper {
|
||||
|
||||
public function __construct(IDBConnection $db) {
|
||||
parent::__construct($db, 'groupfolder_snapshots_tasks', DiffTask::class);
|
||||
}
|
||||
public function __construct(IDBConnection $db) {
|
||||
parent::__construct($db, 'groupfolder_snapshots_tasks', DiffTask::class);
|
||||
}
|
||||
|
||||
public function find(int $id, string $userId) {
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
public function find(int $id, string $userId) {
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
|
||||
$qb->select('*')
|
||||
->from($this->getTableName())
|
||||
->where($qb->expr()->eq('id', $qb->createNamedParameter($id)))
|
||||
->andWhere($qb->expr()->eq('user_id', $qb->createNamedParameter($userId)));
|
||||
$qb->select('*')
|
||||
->from($this->getTableName())
|
||||
->where($qb->expr()->eq('id', $qb->createNamedParameter($id)))
|
||||
->andWhere($qb->expr()->eq('user_id', $qb->createNamedParameter($userId)));
|
||||
|
||||
return $this->findEntity($qb);
|
||||
}
|
||||
return $this->findEntity($qb);
|
||||
}
|
||||
|
||||
public function findAll(string $userId) {
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
public function findAll(string $userId) {
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
|
||||
$qb->select('*')
|
||||
->from($this->getTableName())
|
||||
->where($qb->expr()->eq('user_id', $qb->createNamedParameter($userId)));
|
||||
$qb->select('*')
|
||||
->from($this->getTableName())
|
||||
->where($qb->expr()->eq('user_id', $qb->createNamedParameter($userId)));
|
||||
|
||||
return $this->findEntities($qb);
|
||||
}
|
||||
return $this->findEntities($qb);
|
||||
}
|
||||
|
||||
}
|
|
@ -7,49 +7,49 @@ use OCP\AppFramework\Db\Entity;
|
|||
|
||||
class DiffTaskResult extends Entity implements JsonSerializable {
|
||||
|
||||
protected $taskId;
|
||||
protected $timestamp;
|
||||
protected $type;
|
||||
protected $taskId;
|
||||
protected $timestamp;
|
||||
protected $type;
|
||||
|
||||
protected $beforeFileExists;
|
||||
protected $beforePath;
|
||||
protected $beforeSize;
|
||||
protected $beforeFileExists;
|
||||
protected $beforePath;
|
||||
protected $beforeSize;
|
||||
|
||||
protected $currentFileExists;
|
||||
protected $currentFileId;
|
||||
protected $currentFileExists;
|
||||
protected $currentFileId;
|
||||
|
||||
protected $currentPath;
|
||||
protected $currentSize;
|
||||
protected $currentSize;
|
||||
protected $reverted;
|
||||
|
||||
public function __construct() {
|
||||
$this->addType('id','integer');
|
||||
$this->addType('taskId','integer');
|
||||
$this->addType('beforeFileExists','boolean');
|
||||
$this->addType('beforeSize','integer');
|
||||
$this->addType('currentFileExists','boolean');
|
||||
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('currentFileId','integer');
|
||||
$this->addType('currentSize','integer');
|
||||
$this->addType('currentSize','integer');
|
||||
$this->addType('reverted','boolean');
|
||||
}
|
||||
}
|
||||
|
||||
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,
|
||||
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,
|
||||
'fileId' => $this->currentFileId,
|
||||
'path' => $this->currentPath,
|
||||
'size' => $this->currentSize,
|
||||
'path' => $this->currentPath,
|
||||
'size' => $this->currentSize,
|
||||
],
|
||||
'reverted' => $this->reverted,
|
||||
];
|
||||
}
|
||||
];
|
||||
}
|
||||
}
|
|
@ -9,29 +9,29 @@ use OCP\AppFramework\Db\QBMapper;
|
|||
*/
|
||||
class DiffTaskResultMapper extends QBMapper {
|
||||
|
||||
public function __construct(IDBConnection $db) {
|
||||
parent::__construct($db, 'groupfolder_snapshots_task_results', DiffTaskResult::class);
|
||||
}
|
||||
public function __construct(IDBConnection $db) {
|
||||
parent::__construct($db, 'groupfolder_snapshots_task_results', DiffTaskResult::class);
|
||||
}
|
||||
|
||||
public function find(int $id) {
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
public function find(int $id) {
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
|
||||
$qb->select('*')
|
||||
->from($this->getTableName())
|
||||
->where($qb->expr()->eq('id', $qb->createNamedParameter($id)));
|
||||
$qb->select('*')
|
||||
->from($this->getTableName())
|
||||
->where($qb->expr()->eq('id', $qb->createNamedParameter($id)));
|
||||
|
||||
return $this->findEntity($qb);
|
||||
}
|
||||
return $this->findEntity($qb);
|
||||
}
|
||||
|
||||
public function findAll(int $taskId) {
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
public function findAll(int $taskId) {
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
|
||||
$qb->select('*')
|
||||
->from($this->getTableName())
|
||||
->where($qb->expr()->eq('task_id', $qb->createNamedParameter($taskId)));
|
||||
$qb->select('*')
|
||||
->from($this->getTableName())
|
||||
->where($qb->expr()->eq('task_id', $qb->createNamedParameter($taskId)));
|
||||
|
||||
return $this->findEntities($qb);
|
||||
}
|
||||
return $this->findEntities($qb);
|
||||
}
|
||||
|
||||
public function markReverted(int $id) {
|
||||
$taskResult = $this->find($id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue