1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* FullTextSearch - Full text search framework for Nextcloud |
4
|
|
|
* |
5
|
|
|
* This file is licensed under the Affero General Public License version 3 or |
6
|
|
|
* later. See the COPYING file. |
7
|
|
|
* |
8
|
|
|
* @author Maxence Lange <[email protected]> |
9
|
|
|
* @copyright 2018 |
10
|
|
|
* @license GNU AGPL version 3 or any later version |
11
|
|
|
* |
12
|
|
|
* This program is free software: you can redistribute it and/or modify |
13
|
|
|
* it under the terms of the GNU Affero General Public License as |
14
|
|
|
* published by the Free Software Foundation, either version 3 of the |
15
|
|
|
* License, or (at your option) any later version. |
16
|
|
|
* |
17
|
|
|
* This program is distributed in the hope that it will be useful, |
18
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
19
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
20
|
|
|
* GNU Affero General Public License for more details. |
21
|
|
|
* |
22
|
|
|
* You should have received a copy of the GNU Affero General Public License |
23
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
24
|
|
|
* |
25
|
|
|
*/ |
26
|
|
|
|
27
|
|
|
|
28
|
|
|
namespace OCA\FullTextSearch\Model; |
29
|
|
|
|
30
|
|
|
|
31
|
|
|
use OCA\FullTextSearch\IFullTextSearchProvider; |
32
|
|
|
|
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* Class ProviderWrapper |
36
|
|
|
* |
37
|
|
|
* @package OCA\FullTextSearch\Model |
38
|
|
|
*/ |
39
|
|
|
class ProviderWrapper { |
40
|
|
|
|
41
|
|
|
|
42
|
|
|
/** @var string */ |
43
|
|
|
private $appId; |
44
|
|
|
|
45
|
|
|
/** @var IFullTextSearchProvider */ |
46
|
|
|
private $provider; |
47
|
|
|
|
48
|
|
|
/** @var string */ |
49
|
|
|
private $version; |
50
|
|
|
|
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* Provider constructor. |
54
|
|
|
* |
55
|
|
|
* @param string $appId |
56
|
|
|
* @param IFullTextSearchProvider $provider |
57
|
|
|
*/ |
58
|
|
|
public function __construct($appId, $provider) { |
59
|
|
|
$this->appId = $appId; |
60
|
|
|
$this->provider = $provider; |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* @return string |
65
|
|
|
*/ |
66
|
|
|
public function getAppId() { |
67
|
|
|
return $this->appId; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* @param string $appId |
72
|
|
|
* |
73
|
|
|
* @return ProviderWrapper |
74
|
|
|
*/ |
75
|
|
|
public function setAppId($appId) { |
76
|
|
|
$this->appId = $appId; |
77
|
|
|
|
78
|
|
|
return $this; |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* @return IFullTextSearchProvider |
84
|
|
|
*/ |
85
|
|
|
public function getProvider() { |
86
|
|
|
return $this->provider; |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* @param IFullTextSearchProvider $provider |
91
|
|
|
* |
92
|
|
|
* @return ProviderWrapper |
93
|
|
|
*/ |
94
|
|
|
public function setProvider($provider) { |
95
|
|
|
$this->provider = $provider; |
96
|
|
|
|
97
|
|
|
return $this; |
98
|
|
|
} |
99
|
|
|
|
100
|
|
|
|
101
|
|
|
/** |
102
|
|
|
* @return string |
103
|
|
|
*/ |
104
|
|
|
public function getVersion() { |
105
|
|
|
return $this->version; |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
/** |
109
|
|
|
* @param string $version |
110
|
|
|
* |
111
|
|
|
* @return ProviderWrapper |
112
|
|
|
*/ |
113
|
|
|
public function setVersion($version) { |
114
|
|
|
$this->version = $version; |
115
|
|
|
|
116
|
|
|
return $this; |
117
|
|
|
} |
118
|
|
|
|
119
|
|
|
|
120
|
|
|
} |
121
|
|
|
|