Completed
Push — master ( f82663...d42560 )
by Peter
17:08
created

SearchCriteria   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 1

Test Coverage

Coverage 70%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 4
c 3
b 0
f 0
lcom 2
cbo 1
dl 0
loc 27
ccs 7
cts 10
cp 0.7
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getModels() 0 4 1
A search() 0 4 1
A getSearch() 0 4 1
A add() 0 4 1
1
<?php
2
3
/**
4
 * This software package is licensed under `AGPL, Commercial` license[s].
5
 *
6
 * @package maslosoft/manganel
7
 * @license AGPL, Commercial
8
 *
9
 * @copyright Copyright (c) Peter Maselkowski <[email protected]>
10
 * @link http://maslosoft.com/manganel/
11
 */
12
13
namespace Maslosoft\Manganel;
14
15
use Maslosoft\Mangan\Criteria;
16
17
/**
18
 * SearchCriteria
19
 *
20
 * @author Piotr Maselkowski <pmaselkowski at gmail.com>
21
 */
22
class SearchCriteria extends Criteria
23
{
24
25
	private $query = '';
26
	private $models = [];
27
28
	public function add($model)
29
	{
30
		$this->models[] = $model;
31
	}
32
33 4
	public function getModels()
34
	{
35 4
		return $this->models;
36
	}
37
38 4
	public function search($query)
39
	{
40 4
		$this->query = $query;
41 4
	}
42
43 4
	public function getSearch()
44
	{
45 4
		return $this->query;
46
	}
47
48
}
49