MetaMapper::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 2
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 1
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
15
	public function getAll($userId) {
16
		$qb = $this->db->getQueryBuilder();
17
		$qb->select('*')
18
			->from('*PREFIX*notes_meta')
19
			->where(
20
				$qb->expr()->eq('user_id', $qb->createNamedParameter($userId, IQueryBuilder::PARAM_STR))
21
			);
22
		return $this->findEntities($qb);
23
	}
24
}
25