added DiffTaskResult Entity and Mapper
This commit is contained in:
parent
d8651c7780
commit
29aa0d24fa
2 changed files with 84 additions and 0 deletions
36
lib/Db/DiffTaskResultMapper.php
Normal file
36
lib/Db/DiffTaskResultMapper.php
Normal file
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
namespace OCA\GroupfolderFilesystemSnapshots\Db;
|
||||
|
||||
use OCP\IDBConnection;
|
||||
use OCP\AppFramework\Db\QBMapper;
|
||||
|
||||
/**
|
||||
* @extends QBMapper<DiffTaskResult>
|
||||
*/
|
||||
class DiffTaskResultMapper extends QBMapper {
|
||||
|
||||
public function __construct(IDBConnection $db) {
|
||||
parent::__construct($db, 'groupfolder_snapshots_task_results', DiffTaskResult::class);
|
||||
}
|
||||
|
||||
public function find(int $id) {
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
|
||||
$qb->select('*')
|
||||
->from($this->getTableName())
|
||||
->where($qb->expr()->eq('id', $qb->createNamedParameter($id)));
|
||||
|
||||
return $this->findEntity($qb);
|
||||
}
|
||||
|
||||
public function findAll(int $taskId) {
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
|
||||
$qb->select('*')
|
||||
->from($this->getTableName())
|
||||
->where($qb->expr()->eq('task_id', $qb->createNamedParameter($taskId)));
|
||||
|
||||
return $this->findEntities($qb);
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue