Completed
Push — multimodel-dp ( 745c1d...bcd65b )
by Peter
03:53
created

SearchCriteria   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A add() 0 4 1
A getSearch() 0 4 1
A getModels() 0 4 1
A search() 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
	public function getModels()
34
	{
35
		return $this->models;
36
	}
37
38
	public function search($query)
39
	{
40
		$this->query = $query;
41
	}
42
43 3
	public function getSearch()
44
	{
45 3
		return $this->query;
46
	}
47
48
}
49