MetaMapper   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 8
dl 0
loc 14
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A getAll() 0 8 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