Completed
Push — master ( 0dfb02...aa2861 )
by Peter
13:57
created

SearchCriteria   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 2
cbo 1
dl 0
loc 34
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getModels() 0 4 1
A setModels() 0 5 1
A search() 0 4 1
A getSearch() 0 4 1
A add() 0 5 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
		return $this;
32
	}
33
34 30
	public function getModels()
35
	{
36 30
		return $this->models;
37
	}
38
39 30
	public function setModels($models)
40
	{
41 30
		$this->models = $models;
42 30
		return $this;
43
	}
44
45 13
	public function search($query)
46
	{
47 13
		$this->query = $query;
48 13
	}
49
50 36
	public function getSearch()
51
	{
52 36
		return $this->query;
53
	}
54
55
}
56