Passed
Pull Request — master (#314)
by korelstar
02:14
created

MetaMapper::get()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 3
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 2
1
<?php
2
3
namespace OCA\Notes\Db;
4
5
use OCP\IDBConnection;
6
use OCP\AppFramework\Db\QBMapper;
7
use OCP\DB\QueryBuilder\IQueryBuilder;
8
9
class MetaMapper extends QBMapper {
10
11
	public function __construct(IDBConnection $db) {
12
		parent::__construct($db, 'notes_meta');
13
14
	}
0 ignored issues
show
Coding Style introduced by
Function closing brace must go on the next line following the body; found 1 blank lines before brace
Loading history...
15
16
	public function getAll($userId) {
17
		$qb = $this->db->getQueryBuilder();
18
		$qb->select('*')
19
			->from('*PREFIX*notes_meta')
20
			->where(
21
				$qb->expr()->eq('user_id', $qb->createNamedParameter($userId, IQueryBuilder::PARAM_STR))
22
			);
23
		return $this->findEntities($qb);
24
	}
25
}
26