1
|
|
|
<?php declare(strict_types=1); |
2
|
|
|
/** |
3
|
|
|
* @copyright Copyright (c) 2018 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 SearchDAV\Query; |
23
|
|
|
|
24
|
|
|
|
25
|
|
|
class Scope { |
26
|
|
|
/** |
27
|
|
|
* @var string |
28
|
|
|
* |
29
|
|
|
* The scope of the search, either as absolute uri or as a path relative to the |
30
|
|
|
* search arbiter. |
31
|
|
|
*/ |
32
|
|
|
public $href; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* @var string|int 0, 1 or 'infinite' |
36
|
|
|
* |
37
|
|
|
* How deep the search query should be with 0 being only the scope itself, |
38
|
|
|
* 1 being all direct child entries of the scope and infinite being all entries |
39
|
|
|
* in the scope collection at any depth. |
40
|
|
|
*/ |
41
|
|
|
public $depth; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @var string|null |
45
|
|
|
* |
46
|
|
|
* the path of the search scope relative to the dav server, or null if the scope is outside the dav server |
47
|
|
|
*/ |
48
|
|
|
public $path; |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* @param string $href |
52
|
|
|
* @param int|string $depth |
53
|
|
|
* @param string|null $path |
54
|
|
|
*/ |
55
|
|
|
public function __construct(string $href = '', $depth = 1, string $path = null) { |
56
|
|
|
$this->href = $href; |
57
|
|
|
$this->depth = $depth; |
58
|
|
|
$this->path = $path; |
59
|
|
|
} |
60
|
|
|
} |
61
|
|
|
|