Completed
Pull Request — master (#490)
by
unknown
01:54
created

FilePropertiesMapper::findAll()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
namespace OCA\Gallery\Db;
3
4
use OCP\IDBConnection;
5
use OCP\AppFramework\Db\Mapper;
6
7
class FilePropertiesMapper extends Mapper {
8
9
    public function __construct(IDBConnection $db) {
10
        parent::__construct($db, 'gallery_file_properties');
11
    }
12
13
    /**
14
     * @throws \OCP\AppFramework\Db\DoesNotExistException if not found
15
     * @throws \OCP\AppFramework\Db\MultipleObjectsReturnedException if more than one result
16
     */
17
    public function find($id) {
18
        $sql = 'SELECT * FROM `*PREFIX*gallery_file_properties` ' .
19
            'WHERE `id` = ?';
20
        return $this->findEntity($sql, [$id]);
21
    }
22
23
    public function findAll($limit=null, $offset=null) {
24
        $sql = 'SELECT * FROM `*PREFIX*gallery_file_properties`';
25
        return $this->findEntities($sql, $limit, $offset);
26
    }
27
}
28