Completed
Push — master ( 74ac5d...2a8e92 )
by Robin
24:33
created

SearchQuery::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 4
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/**
3
 * @copyright Copyright (c) 2017 Robin Appelman <[email protected]>
4
 *
5
 * @license GNU AGPL version 3 or any later version
6
 *
7
 * This program is free software: you can redistribute it and/or modify
8
 * it under the terms of the GNU Affero General Public License as
9
 * published by the Free Software Foundation, either version 3 of the
10
 * License, or (at your option) any later version.
11
 *
12
 * This program is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 * GNU Affero General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU Affero General Public License
18
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
 *
20
 */
21
22
namespace OC\Files\Search;
23
24
use OCP\Files\Search\ISearchOperator;
25
use OCP\Files\Search\ISearchOrder;
26
use OCP\Files\Search\ISearchQuery;
27
28
class SearchQuery implements ISearchQuery {
29
	/** @var  ISearchOperator */
30
	private $searchOperation;
31
	/** @var  integer */
32
	private $limit;
33
	/** @var  integer */
34
	private $offset;
35
	/** @var  ISearchOrder[] */
36
	private $order;
37
38
	/**
39
	 * SearchQuery constructor.
40
	 *
41
	 * @param ISearchOperator $searchOperation
42
	 * @param int $limit
43
	 * @param int $offset
44
	 * @param array $order
45
	 */
46
	public function __construct(ISearchOperator $searchOperation, $limit, $offset, array $order) {
47
		$this->searchOperation = $searchOperation;
48
		$this->limit = $limit;
49
		$this->offset = $offset;
50
		$this->order = $order;
51
	}
52
53
	/**
54
	 * @return ISearchOperator
55
	 */
56
	public function getSearchOperation() {
57
		return $this->searchOperation;
58
	}
59
60
	/**
61
	 * @return int
62
	 */
63
	public function getLimit() {
64
		return $this->limit;
65
	}
66
67
	/**
68
	 * @return int
69
	 */
70
	public function getOffset() {
71
		return $this->offset;
72
	}
73
74
	/**
75
	 * @return ISearchOrder[]
76
	 */
77
	public function getOrder() {
78
		return $this->order;
79
	}
80
}
81