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

SearchCriteria::getSearch()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 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