@@ -35,46 +35,46 @@ |
||
35 | 35 | */ |
36 | 36 | interface IAvatar { |
37 | 37 | |
38 | - /** |
|
39 | - * get the users avatar |
|
40 | - * @param int $size size in px of the avatar, avatars are square, defaults to 64, -1 can be used to not scale the image |
|
41 | - * @return boolean|\OCP\IImage containing the avatar or false if there's no image |
|
42 | - * @since 6.0.0 - size of -1 was added in 9.0.0 |
|
43 | - */ |
|
44 | - public function get($size = 64); |
|
38 | + /** |
|
39 | + * get the users avatar |
|
40 | + * @param int $size size in px of the avatar, avatars are square, defaults to 64, -1 can be used to not scale the image |
|
41 | + * @return boolean|\OCP\IImage containing the avatar or false if there's no image |
|
42 | + * @since 6.0.0 - size of -1 was added in 9.0.0 |
|
43 | + */ |
|
44 | + public function get($size = 64); |
|
45 | 45 | |
46 | - /** |
|
47 | - * Check if an avatar exists for the user |
|
48 | - * |
|
49 | - * @return bool |
|
50 | - * @since 8.1.0 |
|
51 | - */ |
|
52 | - public function exists(); |
|
46 | + /** |
|
47 | + * Check if an avatar exists for the user |
|
48 | + * |
|
49 | + * @return bool |
|
50 | + * @since 8.1.0 |
|
51 | + */ |
|
52 | + public function exists(); |
|
53 | 53 | |
54 | - /** |
|
55 | - * sets the users avatar |
|
56 | - * @param \OCP\IImage|resource|string $data An image object, imagedata or path to set a new avatar |
|
57 | - * @throws \Exception if the provided file is not a jpg or png image |
|
58 | - * @throws \Exception if the provided image is not valid |
|
59 | - * @throws \OC\NotSquareException if the image is not square |
|
60 | - * @return void |
|
61 | - * @since 6.0.0 |
|
62 | - */ |
|
63 | - public function set($data); |
|
54 | + /** |
|
55 | + * sets the users avatar |
|
56 | + * @param \OCP\IImage|resource|string $data An image object, imagedata or path to set a new avatar |
|
57 | + * @throws \Exception if the provided file is not a jpg or png image |
|
58 | + * @throws \Exception if the provided image is not valid |
|
59 | + * @throws \OC\NotSquareException if the image is not square |
|
60 | + * @return void |
|
61 | + * @since 6.0.0 |
|
62 | + */ |
|
63 | + public function set($data); |
|
64 | 64 | |
65 | - /** |
|
66 | - * remove the users avatar |
|
67 | - * @return void |
|
68 | - * @since 6.0.0 |
|
69 | - */ |
|
70 | - public function remove(); |
|
65 | + /** |
|
66 | + * remove the users avatar |
|
67 | + * @return void |
|
68 | + * @since 6.0.0 |
|
69 | + */ |
|
70 | + public function remove(); |
|
71 | 71 | |
72 | - /** |
|
73 | - * Get the file of the avatar |
|
74 | - * @param int $size -1 can be used to not scale the image |
|
75 | - * @return File |
|
76 | - * @throws NotFoundException |
|
77 | - * @since 9.0.0 |
|
78 | - */ |
|
79 | - public function getFile($size); |
|
72 | + /** |
|
73 | + * Get the file of the avatar |
|
74 | + * @param int $size -1 can be used to not scale the image |
|
75 | + * @return File |
|
76 | + * @throws NotFoundException |
|
77 | + * @since 9.0.0 |
|
78 | + */ |
|
79 | + public function getFile($size); |
|
80 | 80 | } |
@@ -33,46 +33,46 @@ |
||
33 | 33 | */ |
34 | 34 | interface ISearch { |
35 | 35 | |
36 | - /** |
|
37 | - * Search all providers for $query |
|
38 | - * @param string $query |
|
39 | - * @param string[] $inApps optionally limit results to the given apps |
|
40 | - * @return array An array of OCP\Search\Result's |
|
41 | - * @deprecated 8.0.0 use searchPaged() with page and size |
|
42 | - * @since 7.0.0 - parameter $inApps was added in 8.0.0 |
|
43 | - */ |
|
44 | - public function search($query, array $inApps = array()); |
|
36 | + /** |
|
37 | + * Search all providers for $query |
|
38 | + * @param string $query |
|
39 | + * @param string[] $inApps optionally limit results to the given apps |
|
40 | + * @return array An array of OCP\Search\Result's |
|
41 | + * @deprecated 8.0.0 use searchPaged() with page and size |
|
42 | + * @since 7.0.0 - parameter $inApps was added in 8.0.0 |
|
43 | + */ |
|
44 | + public function search($query, array $inApps = array()); |
|
45 | 45 | |
46 | - /** |
|
47 | - * Search all providers for $query |
|
48 | - * @param string $query |
|
49 | - * @param string[] $inApps optionally limit results to the given apps |
|
50 | - * @param int $page pages start at page 1 |
|
51 | - * @param int $size |
|
52 | - * @return array An array of OCP\Search\Result's |
|
53 | - * @since 8.0.0 |
|
54 | - */ |
|
55 | - public function searchPaged($query, array $inApps = array(), $page = 1, $size = 30); |
|
46 | + /** |
|
47 | + * Search all providers for $query |
|
48 | + * @param string $query |
|
49 | + * @param string[] $inApps optionally limit results to the given apps |
|
50 | + * @param int $page pages start at page 1 |
|
51 | + * @param int $size |
|
52 | + * @return array An array of OCP\Search\Result's |
|
53 | + * @since 8.0.0 |
|
54 | + */ |
|
55 | + public function searchPaged($query, array $inApps = array(), $page = 1, $size = 30); |
|
56 | 56 | |
57 | - /** |
|
58 | - * Register a new search provider to search with |
|
59 | - * @param string $class class name of a OCP\Search\Provider |
|
60 | - * @param array $options optional |
|
61 | - * @since 7.0.0 |
|
62 | - */ |
|
63 | - public function registerProvider($class, array $options = array()); |
|
57 | + /** |
|
58 | + * Register a new search provider to search with |
|
59 | + * @param string $class class name of a OCP\Search\Provider |
|
60 | + * @param array $options optional |
|
61 | + * @since 7.0.0 |
|
62 | + */ |
|
63 | + public function registerProvider($class, array $options = array()); |
|
64 | 64 | |
65 | - /** |
|
66 | - * Remove one existing search provider |
|
67 | - * @param string $provider class name of a OCP\Search\Provider |
|
68 | - * @since 7.0.0 |
|
69 | - */ |
|
70 | - public function removeProvider($provider); |
|
65 | + /** |
|
66 | + * Remove one existing search provider |
|
67 | + * @param string $provider class name of a OCP\Search\Provider |
|
68 | + * @since 7.0.0 |
|
69 | + */ |
|
70 | + public function removeProvider($provider); |
|
71 | 71 | |
72 | - /** |
|
73 | - * Remove all registered search providers |
|
74 | - * @since 7.0.0 |
|
75 | - */ |
|
76 | - public function clearProviders(); |
|
72 | + /** |
|
73 | + * Remove all registered search providers |
|
74 | + * @since 7.0.0 |
|
75 | + */ |
|
76 | + public function clearProviders(); |
|
77 | 77 | |
78 | 78 | } |
@@ -63,217 +63,217 @@ |
||
63 | 63 | * @since 6.0.0 |
64 | 64 | */ |
65 | 65 | interface IRequest { |
66 | - /** |
|
67 | - * @since 9.1.0 |
|
68 | - */ |
|
69 | - const USER_AGENT_CLIENT_ANDROID = '/^Mozilla\/5\.0 \(Android\) ownCloud\-android.*$/'; |
|
66 | + /** |
|
67 | + * @since 9.1.0 |
|
68 | + */ |
|
69 | + const USER_AGENT_CLIENT_ANDROID = '/^Mozilla\/5\.0 \(Android\) ownCloud\-android.*$/'; |
|
70 | 70 | |
71 | - /** |
|
72 | - * @since 9.1.0 |
|
73 | - */ |
|
74 | - const USER_AGENT_CLIENT_DESKTOP = '/^Mozilla\/5\.0 \([A-Za-z ]+\) (mirall|csyncoC)\/.*$/'; |
|
71 | + /** |
|
72 | + * @since 9.1.0 |
|
73 | + */ |
|
74 | + const USER_AGENT_CLIENT_DESKTOP = '/^Mozilla\/5\.0 \([A-Za-z ]+\) (mirall|csyncoC)\/.*$/'; |
|
75 | 75 | |
76 | - /** |
|
77 | - * @since 9.1.0 |
|
78 | - */ |
|
79 | - const USER_AGENT_CLIENT_IOS = '/^Mozilla\/5\.0 \(iOS\) (ownCloud|Nextcloud)\-iOS.*$/'; |
|
76 | + /** |
|
77 | + * @since 9.1.0 |
|
78 | + */ |
|
79 | + const USER_AGENT_CLIENT_IOS = '/^Mozilla\/5\.0 \(iOS\) (ownCloud|Nextcloud)\-iOS.*$/'; |
|
80 | 80 | |
81 | - /** |
|
82 | - * @param string $name |
|
83 | - * |
|
84 | - * @return string |
|
85 | - * @since 6.0.0 |
|
86 | - */ |
|
87 | - public function getHeader($name); |
|
81 | + /** |
|
82 | + * @param string $name |
|
83 | + * |
|
84 | + * @return string |
|
85 | + * @since 6.0.0 |
|
86 | + */ |
|
87 | + public function getHeader($name); |
|
88 | 88 | |
89 | - /** |
|
90 | - * Lets you access post and get parameters by the index |
|
91 | - * In case of json requests the encoded json body is accessed |
|
92 | - * |
|
93 | - * @param string $key the key which you want to access in the URL Parameter |
|
94 | - * placeholder, $_POST or $_GET array. |
|
95 | - * The priority how they're returned is the following: |
|
96 | - * 1. URL parameters |
|
97 | - * 2. POST parameters |
|
98 | - * 3. GET parameters |
|
99 | - * @param mixed $default If the key is not found, this value will be returned |
|
100 | - * @return mixed the content of the array |
|
101 | - * @since 6.0.0 |
|
102 | - */ |
|
103 | - public function getParam($key, $default = null); |
|
89 | + /** |
|
90 | + * Lets you access post and get parameters by the index |
|
91 | + * In case of json requests the encoded json body is accessed |
|
92 | + * |
|
93 | + * @param string $key the key which you want to access in the URL Parameter |
|
94 | + * placeholder, $_POST or $_GET array. |
|
95 | + * The priority how they're returned is the following: |
|
96 | + * 1. URL parameters |
|
97 | + * 2. POST parameters |
|
98 | + * 3. GET parameters |
|
99 | + * @param mixed $default If the key is not found, this value will be returned |
|
100 | + * @return mixed the content of the array |
|
101 | + * @since 6.0.0 |
|
102 | + */ |
|
103 | + public function getParam($key, $default = null); |
|
104 | 104 | |
105 | 105 | |
106 | - /** |
|
107 | - * Returns all params that were received, be it from the request |
|
108 | - * |
|
109 | - * (as GET or POST) or through the URL by the route |
|
110 | - * |
|
111 | - * @return array the array with all parameters |
|
112 | - * @since 6.0.0 |
|
113 | - */ |
|
114 | - public function getParams(); |
|
106 | + /** |
|
107 | + * Returns all params that were received, be it from the request |
|
108 | + * |
|
109 | + * (as GET or POST) or through the URL by the route |
|
110 | + * |
|
111 | + * @return array the array with all parameters |
|
112 | + * @since 6.0.0 |
|
113 | + */ |
|
114 | + public function getParams(); |
|
115 | 115 | |
116 | - /** |
|
117 | - * Returns the method of the request |
|
118 | - * |
|
119 | - * @return string the method of the request (POST, GET, etc) |
|
120 | - * @since 6.0.0 |
|
121 | - */ |
|
122 | - public function getMethod(); |
|
116 | + /** |
|
117 | + * Returns the method of the request |
|
118 | + * |
|
119 | + * @return string the method of the request (POST, GET, etc) |
|
120 | + * @since 6.0.0 |
|
121 | + */ |
|
122 | + public function getMethod(); |
|
123 | 123 | |
124 | - /** |
|
125 | - * Shortcut for accessing an uploaded file through the $_FILES array |
|
126 | - * |
|
127 | - * @param string $key the key that will be taken from the $_FILES array |
|
128 | - * @return array the file in the $_FILES element |
|
129 | - * @since 6.0.0 |
|
130 | - */ |
|
131 | - public function getUploadedFile($key); |
|
124 | + /** |
|
125 | + * Shortcut for accessing an uploaded file through the $_FILES array |
|
126 | + * |
|
127 | + * @param string $key the key that will be taken from the $_FILES array |
|
128 | + * @return array the file in the $_FILES element |
|
129 | + * @since 6.0.0 |
|
130 | + */ |
|
131 | + public function getUploadedFile($key); |
|
132 | 132 | |
133 | 133 | |
134 | - /** |
|
135 | - * Shortcut for getting env variables |
|
136 | - * |
|
137 | - * @param string $key the key that will be taken from the $_ENV array |
|
138 | - * @return array the value in the $_ENV element |
|
139 | - * @since 6.0.0 |
|
140 | - */ |
|
141 | - public function getEnv($key); |
|
134 | + /** |
|
135 | + * Shortcut for getting env variables |
|
136 | + * |
|
137 | + * @param string $key the key that will be taken from the $_ENV array |
|
138 | + * @return array the value in the $_ENV element |
|
139 | + * @since 6.0.0 |
|
140 | + */ |
|
141 | + public function getEnv($key); |
|
142 | 142 | |
143 | 143 | |
144 | - /** |
|
145 | - * Shortcut for getting cookie variables |
|
146 | - * |
|
147 | - * @param string $key the key that will be taken from the $_COOKIE array |
|
148 | - * @return string|null the value in the $_COOKIE element |
|
149 | - * @since 6.0.0 |
|
150 | - */ |
|
151 | - public function getCookie($key); |
|
144 | + /** |
|
145 | + * Shortcut for getting cookie variables |
|
146 | + * |
|
147 | + * @param string $key the key that will be taken from the $_COOKIE array |
|
148 | + * @return string|null the value in the $_COOKIE element |
|
149 | + * @since 6.0.0 |
|
150 | + */ |
|
151 | + public function getCookie($key); |
|
152 | 152 | |
153 | 153 | |
154 | - /** |
|
155 | - * Checks if the CSRF check was correct |
|
156 | - * |
|
157 | - * @return bool true if CSRF check passed |
|
158 | - * @since 6.0.0 |
|
159 | - */ |
|
160 | - public function passesCSRFCheck(); |
|
154 | + /** |
|
155 | + * Checks if the CSRF check was correct |
|
156 | + * |
|
157 | + * @return bool true if CSRF check passed |
|
158 | + * @since 6.0.0 |
|
159 | + */ |
|
160 | + public function passesCSRFCheck(); |
|
161 | 161 | |
162 | - /** |
|
163 | - * Checks if the strict cookie has been sent with the request if the request |
|
164 | - * is including any cookies. |
|
165 | - * |
|
166 | - * @return bool |
|
167 | - * @since 9.0.0 |
|
168 | - */ |
|
169 | - public function passesStrictCookieCheck(); |
|
162 | + /** |
|
163 | + * Checks if the strict cookie has been sent with the request if the request |
|
164 | + * is including any cookies. |
|
165 | + * |
|
166 | + * @return bool |
|
167 | + * @since 9.0.0 |
|
168 | + */ |
|
169 | + public function passesStrictCookieCheck(); |
|
170 | 170 | |
171 | - /** |
|
172 | - * Checks if the lax cookie has been sent with the request if the request |
|
173 | - * is including any cookies. |
|
174 | - * |
|
175 | - * @return bool |
|
176 | - * @since 9.0.0 |
|
177 | - */ |
|
178 | - public function passesLaxCookieCheck(); |
|
171 | + /** |
|
172 | + * Checks if the lax cookie has been sent with the request if the request |
|
173 | + * is including any cookies. |
|
174 | + * |
|
175 | + * @return bool |
|
176 | + * @since 9.0.0 |
|
177 | + */ |
|
178 | + public function passesLaxCookieCheck(); |
|
179 | 179 | |
180 | - /** |
|
181 | - * Returns an ID for the request, value is not guaranteed to be unique and is mostly meant for logging |
|
182 | - * If `mod_unique_id` is installed this value will be taken. |
|
183 | - * |
|
184 | - * @return string |
|
185 | - * @since 8.1.0 |
|
186 | - */ |
|
187 | - public function getId(); |
|
180 | + /** |
|
181 | + * Returns an ID for the request, value is not guaranteed to be unique and is mostly meant for logging |
|
182 | + * If `mod_unique_id` is installed this value will be taken. |
|
183 | + * |
|
184 | + * @return string |
|
185 | + * @since 8.1.0 |
|
186 | + */ |
|
187 | + public function getId(); |
|
188 | 188 | |
189 | - /** |
|
190 | - * Returns the remote address, if the connection came from a trusted proxy |
|
191 | - * and `forwarded_for_headers` has been configured then the IP address |
|
192 | - * specified in this header will be returned instead. |
|
193 | - * Do always use this instead of $_SERVER['REMOTE_ADDR'] |
|
194 | - * |
|
195 | - * @return string IP address |
|
196 | - * @since 8.1.0 |
|
197 | - */ |
|
198 | - public function getRemoteAddress(); |
|
189 | + /** |
|
190 | + * Returns the remote address, if the connection came from a trusted proxy |
|
191 | + * and `forwarded_for_headers` has been configured then the IP address |
|
192 | + * specified in this header will be returned instead. |
|
193 | + * Do always use this instead of $_SERVER['REMOTE_ADDR'] |
|
194 | + * |
|
195 | + * @return string IP address |
|
196 | + * @since 8.1.0 |
|
197 | + */ |
|
198 | + public function getRemoteAddress(); |
|
199 | 199 | |
200 | - /** |
|
201 | - * Returns the server protocol. It respects reverse proxy servers and load |
|
202 | - * balancers. |
|
203 | - * |
|
204 | - * @return string Server protocol (http or https) |
|
205 | - * @since 8.1.0 |
|
206 | - */ |
|
207 | - public function getServerProtocol(); |
|
200 | + /** |
|
201 | + * Returns the server protocol. It respects reverse proxy servers and load |
|
202 | + * balancers. |
|
203 | + * |
|
204 | + * @return string Server protocol (http or https) |
|
205 | + * @since 8.1.0 |
|
206 | + */ |
|
207 | + public function getServerProtocol(); |
|
208 | 208 | |
209 | - /** |
|
210 | - * Returns the used HTTP protocol. |
|
211 | - * |
|
212 | - * @return string HTTP protocol. HTTP/2, HTTP/1.1 or HTTP/1.0. |
|
213 | - * @since 8.2.0 |
|
214 | - */ |
|
215 | - public function getHttpProtocol(); |
|
209 | + /** |
|
210 | + * Returns the used HTTP protocol. |
|
211 | + * |
|
212 | + * @return string HTTP protocol. HTTP/2, HTTP/1.1 or HTTP/1.0. |
|
213 | + * @since 8.2.0 |
|
214 | + */ |
|
215 | + public function getHttpProtocol(); |
|
216 | 216 | |
217 | - /** |
|
218 | - * Returns the request uri, even if the website uses one or more |
|
219 | - * reverse proxies |
|
220 | - * |
|
221 | - * @return string |
|
222 | - * @since 8.1.0 |
|
223 | - */ |
|
224 | - public function getRequestUri(); |
|
217 | + /** |
|
218 | + * Returns the request uri, even if the website uses one or more |
|
219 | + * reverse proxies |
|
220 | + * |
|
221 | + * @return string |
|
222 | + * @since 8.1.0 |
|
223 | + */ |
|
224 | + public function getRequestUri(); |
|
225 | 225 | |
226 | - /** |
|
227 | - * Get raw PathInfo from request (not urldecoded) |
|
228 | - * |
|
229 | - * @throws \Exception |
|
230 | - * @return string Path info |
|
231 | - * @since 8.1.0 |
|
232 | - */ |
|
233 | - public function getRawPathInfo(); |
|
226 | + /** |
|
227 | + * Get raw PathInfo from request (not urldecoded) |
|
228 | + * |
|
229 | + * @throws \Exception |
|
230 | + * @return string Path info |
|
231 | + * @since 8.1.0 |
|
232 | + */ |
|
233 | + public function getRawPathInfo(); |
|
234 | 234 | |
235 | - /** |
|
236 | - * Get PathInfo from request |
|
237 | - * |
|
238 | - * @throws \Exception |
|
239 | - * @return string|false Path info or false when not found |
|
240 | - * @since 8.1.0 |
|
241 | - */ |
|
242 | - public function getPathInfo(); |
|
235 | + /** |
|
236 | + * Get PathInfo from request |
|
237 | + * |
|
238 | + * @throws \Exception |
|
239 | + * @return string|false Path info or false when not found |
|
240 | + * @since 8.1.0 |
|
241 | + */ |
|
242 | + public function getPathInfo(); |
|
243 | 243 | |
244 | - /** |
|
245 | - * Returns the script name, even if the website uses one or more |
|
246 | - * reverse proxies |
|
247 | - * |
|
248 | - * @return string the script name |
|
249 | - * @since 8.1.0 |
|
250 | - */ |
|
251 | - public function getScriptName(); |
|
244 | + /** |
|
245 | + * Returns the script name, even if the website uses one or more |
|
246 | + * reverse proxies |
|
247 | + * |
|
248 | + * @return string the script name |
|
249 | + * @since 8.1.0 |
|
250 | + */ |
|
251 | + public function getScriptName(); |
|
252 | 252 | |
253 | - /** |
|
254 | - * Checks whether the user agent matches a given regex |
|
255 | - * |
|
256 | - * @param array $agent array of agent names |
|
257 | - * @return bool true if at least one of the given agent matches, false otherwise |
|
258 | - * @since 8.1.0 |
|
259 | - */ |
|
260 | - public function isUserAgent(array $agent); |
|
253 | + /** |
|
254 | + * Checks whether the user agent matches a given regex |
|
255 | + * |
|
256 | + * @param array $agent array of agent names |
|
257 | + * @return bool true if at least one of the given agent matches, false otherwise |
|
258 | + * @since 8.1.0 |
|
259 | + */ |
|
260 | + public function isUserAgent(array $agent); |
|
261 | 261 | |
262 | - /** |
|
263 | - * Returns the unverified server host from the headers without checking |
|
264 | - * whether it is a trusted domain |
|
265 | - * |
|
266 | - * @return string Server host |
|
267 | - * @since 8.1.0 |
|
268 | - */ |
|
269 | - public function getInsecureServerHost(); |
|
262 | + /** |
|
263 | + * Returns the unverified server host from the headers without checking |
|
264 | + * whether it is a trusted domain |
|
265 | + * |
|
266 | + * @return string Server host |
|
267 | + * @since 8.1.0 |
|
268 | + */ |
|
269 | + public function getInsecureServerHost(); |
|
270 | 270 | |
271 | - /** |
|
272 | - * Returns the server host from the headers, or the first configured |
|
273 | - * trusted domain if the host isn't in the trusted list |
|
274 | - * |
|
275 | - * @return string Server host |
|
276 | - * @since 8.1.0 |
|
277 | - */ |
|
278 | - public function getServerHost(); |
|
271 | + /** |
|
272 | + * Returns the server host from the headers, or the first configured |
|
273 | + * trusted domain if the host isn't in the trusted list |
|
274 | + * |
|
275 | + * @return string Server host |
|
276 | + * @since 8.1.0 |
|
277 | + */ |
|
278 | + public function getServerHost(); |
|
279 | 279 | } |
@@ -29,41 +29,41 @@ |
||
29 | 29 | */ |
30 | 30 | interface ISystemTag { |
31 | 31 | |
32 | - /** |
|
33 | - * Returns the tag id |
|
34 | - * |
|
35 | - * @return string id |
|
36 | - * |
|
37 | - * @since 9.0.0 |
|
38 | - */ |
|
39 | - public function getId(); |
|
32 | + /** |
|
33 | + * Returns the tag id |
|
34 | + * |
|
35 | + * @return string id |
|
36 | + * |
|
37 | + * @since 9.0.0 |
|
38 | + */ |
|
39 | + public function getId(); |
|
40 | 40 | |
41 | - /** |
|
42 | - * Returns the tag display name |
|
43 | - * |
|
44 | - * @return string tag display name |
|
45 | - * |
|
46 | - * @since 9.0.0 |
|
47 | - */ |
|
48 | - public function getName(); |
|
41 | + /** |
|
42 | + * Returns the tag display name |
|
43 | + * |
|
44 | + * @return string tag display name |
|
45 | + * |
|
46 | + * @since 9.0.0 |
|
47 | + */ |
|
48 | + public function getName(); |
|
49 | 49 | |
50 | - /** |
|
51 | - * Returns whether the tag is visible for regular users |
|
52 | - * |
|
53 | - * @return bool true if visible, false otherwise |
|
54 | - * |
|
55 | - * @since 9.0.0 |
|
56 | - */ |
|
57 | - public function isUserVisible(); |
|
50 | + /** |
|
51 | + * Returns whether the tag is visible for regular users |
|
52 | + * |
|
53 | + * @return bool true if visible, false otherwise |
|
54 | + * |
|
55 | + * @since 9.0.0 |
|
56 | + */ |
|
57 | + public function isUserVisible(); |
|
58 | 58 | |
59 | - /** |
|
60 | - * Returns whether the tag can be assigned to objects by regular users |
|
61 | - * |
|
62 | - * @return bool true if assignable, false otherwise |
|
63 | - * |
|
64 | - * @since 9.0.0 |
|
65 | - */ |
|
66 | - public function isUserAssignable(); |
|
59 | + /** |
|
60 | + * Returns whether the tag can be assigned to objects by regular users |
|
61 | + * |
|
62 | + * @return bool true if assignable, false otherwise |
|
63 | + * |
|
64 | + * @since 9.0.0 |
|
65 | + */ |
|
66 | + public function isUserAssignable(); |
|
67 | 67 | |
68 | 68 | } |
69 | 69 |
@@ -32,63 +32,63 @@ |
||
32 | 32 | */ |
33 | 33 | class MapperEvent extends Event { |
34 | 34 | |
35 | - const EVENT_ASSIGN = 'OCP\SystemTag\ISystemTagObjectMapper::assignTags'; |
|
36 | - const EVENT_UNASSIGN = 'OCP\SystemTag\ISystemTagObjectMapper::unassignTags'; |
|
35 | + const EVENT_ASSIGN = 'OCP\SystemTag\ISystemTagObjectMapper::assignTags'; |
|
36 | + const EVENT_UNASSIGN = 'OCP\SystemTag\ISystemTagObjectMapper::unassignTags'; |
|
37 | 37 | |
38 | - /** @var string */ |
|
39 | - protected $event; |
|
40 | - /** @var string */ |
|
41 | - protected $objectType; |
|
42 | - /** @var string */ |
|
43 | - protected $objectId; |
|
44 | - /** @var int[] */ |
|
45 | - protected $tags; |
|
38 | + /** @var string */ |
|
39 | + protected $event; |
|
40 | + /** @var string */ |
|
41 | + protected $objectType; |
|
42 | + /** @var string */ |
|
43 | + protected $objectId; |
|
44 | + /** @var int[] */ |
|
45 | + protected $tags; |
|
46 | 46 | |
47 | - /** |
|
48 | - * DispatcherEvent constructor. |
|
49 | - * |
|
50 | - * @param string $event |
|
51 | - * @param string $objectType |
|
52 | - * @param string $objectId |
|
53 | - * @param int[] $tags |
|
54 | - * @since 9.0.0 |
|
55 | - */ |
|
56 | - public function __construct($event, $objectType, $objectId, array $tags) { |
|
57 | - $this->event = $event; |
|
58 | - $this->objectType = $objectType; |
|
59 | - $this->objectId = $objectId; |
|
60 | - $this->tags = $tags; |
|
61 | - } |
|
47 | + /** |
|
48 | + * DispatcherEvent constructor. |
|
49 | + * |
|
50 | + * @param string $event |
|
51 | + * @param string $objectType |
|
52 | + * @param string $objectId |
|
53 | + * @param int[] $tags |
|
54 | + * @since 9.0.0 |
|
55 | + */ |
|
56 | + public function __construct($event, $objectType, $objectId, array $tags) { |
|
57 | + $this->event = $event; |
|
58 | + $this->objectType = $objectType; |
|
59 | + $this->objectId = $objectId; |
|
60 | + $this->tags = $tags; |
|
61 | + } |
|
62 | 62 | |
63 | - /** |
|
64 | - * @return string |
|
65 | - * @since 9.0.0 |
|
66 | - */ |
|
67 | - public function getEvent() { |
|
68 | - return $this->event; |
|
69 | - } |
|
63 | + /** |
|
64 | + * @return string |
|
65 | + * @since 9.0.0 |
|
66 | + */ |
|
67 | + public function getEvent() { |
|
68 | + return $this->event; |
|
69 | + } |
|
70 | 70 | |
71 | - /** |
|
72 | - * @return string |
|
73 | - * @since 9.0.0 |
|
74 | - */ |
|
75 | - public function getObjectType() { |
|
76 | - return $this->objectType; |
|
77 | - } |
|
71 | + /** |
|
72 | + * @return string |
|
73 | + * @since 9.0.0 |
|
74 | + */ |
|
75 | + public function getObjectType() { |
|
76 | + return $this->objectType; |
|
77 | + } |
|
78 | 78 | |
79 | - /** |
|
80 | - * @return string |
|
81 | - * @since 9.0.0 |
|
82 | - */ |
|
83 | - public function getObjectId() { |
|
84 | - return $this->objectId; |
|
85 | - } |
|
79 | + /** |
|
80 | + * @return string |
|
81 | + * @since 9.0.0 |
|
82 | + */ |
|
83 | + public function getObjectId() { |
|
84 | + return $this->objectId; |
|
85 | + } |
|
86 | 86 | |
87 | - /** |
|
88 | - * @return int[] |
|
89 | - * @since 9.0.0 |
|
90 | - */ |
|
91 | - public function getTags() { |
|
92 | - return $this->tags; |
|
93 | - } |
|
87 | + /** |
|
88 | + * @return int[] |
|
89 | + * @since 9.0.0 |
|
90 | + */ |
|
91 | + public function getTags() { |
|
92 | + return $this->tags; |
|
93 | + } |
|
94 | 94 | } |
@@ -33,28 +33,28 @@ |
||
33 | 33 | */ |
34 | 34 | interface ISystemTagManagerFactory { |
35 | 35 | |
36 | - /** |
|
37 | - * Constructor for the system tag manager factory |
|
38 | - * |
|
39 | - * @param IServerContainer $serverContainer server container |
|
40 | - * @since 9.0.0 |
|
41 | - */ |
|
42 | - public function __construct(IServerContainer $serverContainer); |
|
36 | + /** |
|
37 | + * Constructor for the system tag manager factory |
|
38 | + * |
|
39 | + * @param IServerContainer $serverContainer server container |
|
40 | + * @since 9.0.0 |
|
41 | + */ |
|
42 | + public function __construct(IServerContainer $serverContainer); |
|
43 | 43 | |
44 | - /** |
|
45 | - * creates and returns an instance of the system tag manager |
|
46 | - * |
|
47 | - * @return ISystemTagManager |
|
48 | - * @since 9.0.0 |
|
49 | - */ |
|
50 | - public function getManager(); |
|
44 | + /** |
|
45 | + * creates and returns an instance of the system tag manager |
|
46 | + * |
|
47 | + * @return ISystemTagManager |
|
48 | + * @since 9.0.0 |
|
49 | + */ |
|
50 | + public function getManager(); |
|
51 | 51 | |
52 | - /** |
|
53 | - * creates and returns an instance of the system tag object |
|
54 | - * mapper |
|
55 | - * |
|
56 | - * @return ISystemTagObjectMapper |
|
57 | - * @since 9.0.0 |
|
58 | - */ |
|
59 | - public function getObjectMapper(); |
|
52 | + /** |
|
53 | + * creates and returns an instance of the system tag object |
|
54 | + * mapper |
|
55 | + * |
|
56 | + * @return ISystemTagObjectMapper |
|
57 | + * @since 9.0.0 |
|
58 | + */ |
|
59 | + public function getObjectMapper(); |
|
60 | 60 | } |
@@ -30,102 +30,102 @@ |
||
30 | 30 | */ |
31 | 31 | interface ISystemTagObjectMapper { |
32 | 32 | |
33 | - /** |
|
34 | - * Get a list of tag ids for the given object ids. |
|
35 | - * |
|
36 | - * This returns an array that maps object id to tag ids |
|
37 | - * [ |
|
38 | - * 1 => array('id1', 'id2'), |
|
39 | - * 2 => array('id3', 'id2'), |
|
40 | - * 3 => array('id5'), |
|
41 | - * 4 => array() |
|
42 | - * ] |
|
43 | - * |
|
44 | - * Untagged objects will have an empty array associated. |
|
45 | - * |
|
46 | - * @param string|array $objIds object ids |
|
47 | - * @param string $objectType object type |
|
48 | - * |
|
49 | - * @return array with object id as key and an array |
|
50 | - * of tag ids as value |
|
51 | - * |
|
52 | - * @since 9.0.0 |
|
53 | - */ |
|
54 | - public function getTagIdsForObjects($objIds, $objectType); |
|
33 | + /** |
|
34 | + * Get a list of tag ids for the given object ids. |
|
35 | + * |
|
36 | + * This returns an array that maps object id to tag ids |
|
37 | + * [ |
|
38 | + * 1 => array('id1', 'id2'), |
|
39 | + * 2 => array('id3', 'id2'), |
|
40 | + * 3 => array('id5'), |
|
41 | + * 4 => array() |
|
42 | + * ] |
|
43 | + * |
|
44 | + * Untagged objects will have an empty array associated. |
|
45 | + * |
|
46 | + * @param string|array $objIds object ids |
|
47 | + * @param string $objectType object type |
|
48 | + * |
|
49 | + * @return array with object id as key and an array |
|
50 | + * of tag ids as value |
|
51 | + * |
|
52 | + * @since 9.0.0 |
|
53 | + */ |
|
54 | + public function getTagIdsForObjects($objIds, $objectType); |
|
55 | 55 | |
56 | - /** |
|
57 | - * Get a list of objects tagged with $tagIds. |
|
58 | - * |
|
59 | - * @param string|array $tagIds Tag id or array of tag ids. |
|
60 | - * @param string $objectType object type |
|
61 | - * @param int $limit Count of object ids you want to get |
|
62 | - * @param string $offset The last object id you already received |
|
63 | - * |
|
64 | - * @return string[] array of object ids or empty array if none found |
|
65 | - * |
|
66 | - * @throws \OCP\SystemTag\TagNotFoundException if at least one of the |
|
67 | - * given tags does not exist |
|
68 | - * @throws \InvalidArgumentException When a limit is specified together with |
|
69 | - * multiple tag ids |
|
70 | - * |
|
71 | - * @since 9.0.0 |
|
72 | - */ |
|
73 | - public function getObjectIdsForTags($tagIds, $objectType, $limit = 0, $offset = ''); |
|
56 | + /** |
|
57 | + * Get a list of objects tagged with $tagIds. |
|
58 | + * |
|
59 | + * @param string|array $tagIds Tag id or array of tag ids. |
|
60 | + * @param string $objectType object type |
|
61 | + * @param int $limit Count of object ids you want to get |
|
62 | + * @param string $offset The last object id you already received |
|
63 | + * |
|
64 | + * @return string[] array of object ids or empty array if none found |
|
65 | + * |
|
66 | + * @throws \OCP\SystemTag\TagNotFoundException if at least one of the |
|
67 | + * given tags does not exist |
|
68 | + * @throws \InvalidArgumentException When a limit is specified together with |
|
69 | + * multiple tag ids |
|
70 | + * |
|
71 | + * @since 9.0.0 |
|
72 | + */ |
|
73 | + public function getObjectIdsForTags($tagIds, $objectType, $limit = 0, $offset = ''); |
|
74 | 74 | |
75 | - /** |
|
76 | - * Assign the given tags to the given object. |
|
77 | - * |
|
78 | - * If at least one of the given tag ids doesn't exist, none of the tags |
|
79 | - * will be assigned. |
|
80 | - * |
|
81 | - * If the relationship already existed, fail silently. |
|
82 | - * |
|
83 | - * @param string $objId object id |
|
84 | - * @param string $objectType object type |
|
85 | - * @param string|array $tagIds tag id or array of tag ids to assign |
|
86 | - * |
|
87 | - * @throws \OCP\SystemTag\TagNotFoundException if at least one of the |
|
88 | - * given tags does not exist |
|
89 | - * |
|
90 | - * @since 9.0.0 |
|
91 | - */ |
|
92 | - public function assignTags($objId, $objectType, $tagIds); |
|
75 | + /** |
|
76 | + * Assign the given tags to the given object. |
|
77 | + * |
|
78 | + * If at least one of the given tag ids doesn't exist, none of the tags |
|
79 | + * will be assigned. |
|
80 | + * |
|
81 | + * If the relationship already existed, fail silently. |
|
82 | + * |
|
83 | + * @param string $objId object id |
|
84 | + * @param string $objectType object type |
|
85 | + * @param string|array $tagIds tag id or array of tag ids to assign |
|
86 | + * |
|
87 | + * @throws \OCP\SystemTag\TagNotFoundException if at least one of the |
|
88 | + * given tags does not exist |
|
89 | + * |
|
90 | + * @since 9.0.0 |
|
91 | + */ |
|
92 | + public function assignTags($objId, $objectType, $tagIds); |
|
93 | 93 | |
94 | - /** |
|
95 | - * Unassign the given tags from the given object. |
|
96 | - * |
|
97 | - * If at least one of the given tag ids doesn't exist, none of the tags |
|
98 | - * will be unassigned. |
|
99 | - * |
|
100 | - * If the relationship did not exist in the first place, fail silently. |
|
101 | - * |
|
102 | - * @param string $objId object id |
|
103 | - * @param string $objectType object type |
|
104 | - * @param string|array $tagIds tag id or array of tag ids to unassign |
|
105 | - * |
|
106 | - * @throws \OCP\SystemTag\TagNotFoundException if at least one of the |
|
107 | - * given tags does not exist |
|
108 | - * |
|
109 | - * @since 9.0.0 |
|
110 | - */ |
|
111 | - public function unassignTags($objId, $objectType, $tagIds); |
|
94 | + /** |
|
95 | + * Unassign the given tags from the given object. |
|
96 | + * |
|
97 | + * If at least one of the given tag ids doesn't exist, none of the tags |
|
98 | + * will be unassigned. |
|
99 | + * |
|
100 | + * If the relationship did not exist in the first place, fail silently. |
|
101 | + * |
|
102 | + * @param string $objId object id |
|
103 | + * @param string $objectType object type |
|
104 | + * @param string|array $tagIds tag id or array of tag ids to unassign |
|
105 | + * |
|
106 | + * @throws \OCP\SystemTag\TagNotFoundException if at least one of the |
|
107 | + * given tags does not exist |
|
108 | + * |
|
109 | + * @since 9.0.0 |
|
110 | + */ |
|
111 | + public function unassignTags($objId, $objectType, $tagIds); |
|
112 | 112 | |
113 | - /** |
|
114 | - * Checks whether the given objects have the given tag. |
|
115 | - * |
|
116 | - * @param string|array $objIds object ids |
|
117 | - * @param string $objectType object type |
|
118 | - * @param string $tagId tag id to check |
|
119 | - * @param bool $all true to check that ALL objects have the tag assigned, |
|
120 | - * false to check that at least ONE object has the tag. |
|
121 | - * |
|
122 | - * @return bool true if the condition set by $all is matched, false |
|
123 | - * otherwise |
|
124 | - * |
|
125 | - * @throws \OCP\SystemTag\TagNotFoundException if the tag does not exist |
|
126 | - * |
|
127 | - * @since 9.0.0 |
|
128 | - */ |
|
129 | - public function haveTag($objIds, $objectType, $tagId, $all = true); |
|
113 | + /** |
|
114 | + * Checks whether the given objects have the given tag. |
|
115 | + * |
|
116 | + * @param string|array $objIds object ids |
|
117 | + * @param string $objectType object type |
|
118 | + * @param string $tagId tag id to check |
|
119 | + * @param bool $all true to check that ALL objects have the tag assigned, |
|
120 | + * false to check that at least ONE object has the tag. |
|
121 | + * |
|
122 | + * @return bool true if the condition set by $all is matched, false |
|
123 | + * otherwise |
|
124 | + * |
|
125 | + * @throws \OCP\SystemTag\TagNotFoundException if the tag does not exist |
|
126 | + * |
|
127 | + * @since 9.0.0 |
|
128 | + */ |
|
129 | + public function haveTag($objIds, $objectType, $tagId, $all = true); |
|
130 | 130 | |
131 | 131 | } |
@@ -32,46 +32,46 @@ |
||
32 | 32 | */ |
33 | 33 | class SystemTagsEntityEvent extends Event { |
34 | 34 | |
35 | - const EVENT_ENTITY = 'OCP\SystemTag\ISystemTagManager::registerEntity'; |
|
35 | + const EVENT_ENTITY = 'OCP\SystemTag\ISystemTagManager::registerEntity'; |
|
36 | 36 | |
37 | - /** @var string */ |
|
38 | - protected $event; |
|
39 | - /** @var \Closure[] */ |
|
40 | - protected $collections; |
|
37 | + /** @var string */ |
|
38 | + protected $event; |
|
39 | + /** @var \Closure[] */ |
|
40 | + protected $collections; |
|
41 | 41 | |
42 | - /** |
|
43 | - * SystemTagsEntityEvent constructor. |
|
44 | - * |
|
45 | - * @param string $event |
|
46 | - * @since 9.1.0 |
|
47 | - */ |
|
48 | - public function __construct($event) { |
|
49 | - $this->event = $event; |
|
50 | - $this->collections = []; |
|
51 | - } |
|
42 | + /** |
|
43 | + * SystemTagsEntityEvent constructor. |
|
44 | + * |
|
45 | + * @param string $event |
|
46 | + * @since 9.1.0 |
|
47 | + */ |
|
48 | + public function __construct($event) { |
|
49 | + $this->event = $event; |
|
50 | + $this->collections = []; |
|
51 | + } |
|
52 | 52 | |
53 | - /** |
|
54 | - * @param string $name |
|
55 | - * @param \Closure $entityExistsFunction The closure should take one |
|
56 | - * argument, which is the id of the entity, that tags |
|
57 | - * should be handled for. The return should then be bool, |
|
58 | - * depending on whether tags are allowed (true) or not. |
|
59 | - * @throws \OutOfBoundsException when the entity name is already taken |
|
60 | - * @since 9.1.0 |
|
61 | - */ |
|
62 | - public function addEntityCollection($name, \Closure $entityExistsFunction) { |
|
63 | - if (isset($this->collections[$name])) { |
|
64 | - throw new \OutOfBoundsException('Duplicate entity name "' . $name . '"'); |
|
65 | - } |
|
53 | + /** |
|
54 | + * @param string $name |
|
55 | + * @param \Closure $entityExistsFunction The closure should take one |
|
56 | + * argument, which is the id of the entity, that tags |
|
57 | + * should be handled for. The return should then be bool, |
|
58 | + * depending on whether tags are allowed (true) or not. |
|
59 | + * @throws \OutOfBoundsException when the entity name is already taken |
|
60 | + * @since 9.1.0 |
|
61 | + */ |
|
62 | + public function addEntityCollection($name, \Closure $entityExistsFunction) { |
|
63 | + if (isset($this->collections[$name])) { |
|
64 | + throw new \OutOfBoundsException('Duplicate entity name "' . $name . '"'); |
|
65 | + } |
|
66 | 66 | |
67 | - $this->collections[$name] = $entityExistsFunction; |
|
68 | - } |
|
67 | + $this->collections[$name] = $entityExistsFunction; |
|
68 | + } |
|
69 | 69 | |
70 | - /** |
|
71 | - * @return \Closure[] |
|
72 | - * @since 9.1.0 |
|
73 | - */ |
|
74 | - public function getEntityCollections() { |
|
75 | - return $this->collections; |
|
76 | - } |
|
70 | + /** |
|
71 | + * @return \Closure[] |
|
72 | + * @since 9.1.0 |
|
73 | + */ |
|
74 | + public function getEntityCollections() { |
|
75 | + return $this->collections; |
|
76 | + } |
|
77 | 77 | } |
@@ -33,133 +33,133 @@ |
||
33 | 33 | */ |
34 | 34 | interface ISystemTagManager { |
35 | 35 | |
36 | - /** |
|
37 | - * Returns the tag objects matching the given tag ids. |
|
38 | - * |
|
39 | - * @param array|string $tagIds id or array of unique ids of the tag to retrieve |
|
40 | - * |
|
41 | - * @return \OCP\SystemTag\ISystemTag[] array of system tags with tag id as key |
|
42 | - * |
|
43 | - * @throws \InvalidArgumentException if at least one given tag ids is invalid (string instead of integer, etc.) |
|
44 | - * @throws \OCP\SystemTag\TagNotFoundException if at least one given tag ids did no exist |
|
45 | - * The message contains a json_encoded array of the ids that could not be found |
|
46 | - * |
|
47 | - * @since 9.0.0 |
|
48 | - */ |
|
49 | - public function getTagsByIds($tagIds); |
|
36 | + /** |
|
37 | + * Returns the tag objects matching the given tag ids. |
|
38 | + * |
|
39 | + * @param array|string $tagIds id or array of unique ids of the tag to retrieve |
|
40 | + * |
|
41 | + * @return \OCP\SystemTag\ISystemTag[] array of system tags with tag id as key |
|
42 | + * |
|
43 | + * @throws \InvalidArgumentException if at least one given tag ids is invalid (string instead of integer, etc.) |
|
44 | + * @throws \OCP\SystemTag\TagNotFoundException if at least one given tag ids did no exist |
|
45 | + * The message contains a json_encoded array of the ids that could not be found |
|
46 | + * |
|
47 | + * @since 9.0.0 |
|
48 | + */ |
|
49 | + public function getTagsByIds($tagIds); |
|
50 | 50 | |
51 | - /** |
|
52 | - * Returns the tag object matching the given attributes. |
|
53 | - * |
|
54 | - * @param string $tagName tag name |
|
55 | - * @param bool $userVisible whether the tag is visible by users |
|
56 | - * @param bool $userAssignable whether the tag is assignable by users |
|
57 | - * |
|
58 | - * @return \OCP\SystemTag\ISystemTag system tag |
|
59 | - * |
|
60 | - * @throws \OCP\SystemTag\TagNotFoundException if tag does not exist |
|
61 | - * |
|
62 | - * @since 9.0.0 |
|
63 | - */ |
|
64 | - public function getTag($tagName, $userVisible, $userAssignable); |
|
51 | + /** |
|
52 | + * Returns the tag object matching the given attributes. |
|
53 | + * |
|
54 | + * @param string $tagName tag name |
|
55 | + * @param bool $userVisible whether the tag is visible by users |
|
56 | + * @param bool $userAssignable whether the tag is assignable by users |
|
57 | + * |
|
58 | + * @return \OCP\SystemTag\ISystemTag system tag |
|
59 | + * |
|
60 | + * @throws \OCP\SystemTag\TagNotFoundException if tag does not exist |
|
61 | + * |
|
62 | + * @since 9.0.0 |
|
63 | + */ |
|
64 | + public function getTag($tagName, $userVisible, $userAssignable); |
|
65 | 65 | |
66 | - /** |
|
67 | - * Creates the tag object using the given attributes. |
|
68 | - * |
|
69 | - * @param string $tagName tag name |
|
70 | - * @param bool $userVisible whether the tag is visible by users |
|
71 | - * @param bool $userAssignable whether the tag is assignable by users |
|
72 | - * |
|
73 | - * @return \OCP\SystemTag\ISystemTag system tag |
|
74 | - * |
|
75 | - * @throws \OCP\SystemTag\TagAlreadyExistsException if tag already exists |
|
76 | - * |
|
77 | - * @since 9.0.0 |
|
78 | - */ |
|
79 | - public function createTag($tagName, $userVisible, $userAssignable); |
|
66 | + /** |
|
67 | + * Creates the tag object using the given attributes. |
|
68 | + * |
|
69 | + * @param string $tagName tag name |
|
70 | + * @param bool $userVisible whether the tag is visible by users |
|
71 | + * @param bool $userAssignable whether the tag is assignable by users |
|
72 | + * |
|
73 | + * @return \OCP\SystemTag\ISystemTag system tag |
|
74 | + * |
|
75 | + * @throws \OCP\SystemTag\TagAlreadyExistsException if tag already exists |
|
76 | + * |
|
77 | + * @since 9.0.0 |
|
78 | + */ |
|
79 | + public function createTag($tagName, $userVisible, $userAssignable); |
|
80 | 80 | |
81 | - /** |
|
82 | - * Returns all known tags, optionally filtered by visibility. |
|
83 | - * |
|
84 | - * @param bool|null $visibilityFilter filter by visibility if non-null |
|
85 | - * @param string $nameSearchPattern optional search pattern for the tag name |
|
86 | - * |
|
87 | - * @return \OCP\SystemTag\ISystemTag[] array of system tags or empty array if none found |
|
88 | - * |
|
89 | - * @since 9.0.0 |
|
90 | - */ |
|
91 | - public function getAllTags($visibilityFilter = null, $nameSearchPattern = null); |
|
81 | + /** |
|
82 | + * Returns all known tags, optionally filtered by visibility. |
|
83 | + * |
|
84 | + * @param bool|null $visibilityFilter filter by visibility if non-null |
|
85 | + * @param string $nameSearchPattern optional search pattern for the tag name |
|
86 | + * |
|
87 | + * @return \OCP\SystemTag\ISystemTag[] array of system tags or empty array if none found |
|
88 | + * |
|
89 | + * @since 9.0.0 |
|
90 | + */ |
|
91 | + public function getAllTags($visibilityFilter = null, $nameSearchPattern = null); |
|
92 | 92 | |
93 | - /** |
|
94 | - * Updates the given tag |
|
95 | - * |
|
96 | - * @param string $tagId tag id |
|
97 | - * @param string $newName the new tag name |
|
98 | - * @param bool $userVisible whether the tag is visible by users |
|
99 | - * @param bool $userAssignable whether the tag is assignable by users |
|
100 | - * |
|
101 | - * @throws \OCP\SystemTag\TagNotFoundException if tag with the given id does not exist |
|
102 | - * @throws \OCP\SystemTag\TagAlreadyExistsException if there is already another tag |
|
103 | - * with the same attributes |
|
104 | - * |
|
105 | - * @since 9.0.0 |
|
106 | - */ |
|
107 | - public function updateTag($tagId, $newName, $userVisible, $userAssignable); |
|
93 | + /** |
|
94 | + * Updates the given tag |
|
95 | + * |
|
96 | + * @param string $tagId tag id |
|
97 | + * @param string $newName the new tag name |
|
98 | + * @param bool $userVisible whether the tag is visible by users |
|
99 | + * @param bool $userAssignable whether the tag is assignable by users |
|
100 | + * |
|
101 | + * @throws \OCP\SystemTag\TagNotFoundException if tag with the given id does not exist |
|
102 | + * @throws \OCP\SystemTag\TagAlreadyExistsException if there is already another tag |
|
103 | + * with the same attributes |
|
104 | + * |
|
105 | + * @since 9.0.0 |
|
106 | + */ |
|
107 | + public function updateTag($tagId, $newName, $userVisible, $userAssignable); |
|
108 | 108 | |
109 | - /** |
|
110 | - * Delete the given tags from the database and all their relationships. |
|
111 | - * |
|
112 | - * @param string|array $tagIds array of tag ids |
|
113 | - * |
|
114 | - * @throws \OCP\SystemTag\TagNotFoundException if at least one tag did not exist |
|
115 | - * |
|
116 | - * @since 9.0.0 |
|
117 | - */ |
|
118 | - public function deleteTags($tagIds); |
|
109 | + /** |
|
110 | + * Delete the given tags from the database and all their relationships. |
|
111 | + * |
|
112 | + * @param string|array $tagIds array of tag ids |
|
113 | + * |
|
114 | + * @throws \OCP\SystemTag\TagNotFoundException if at least one tag did not exist |
|
115 | + * |
|
116 | + * @since 9.0.0 |
|
117 | + */ |
|
118 | + public function deleteTags($tagIds); |
|
119 | 119 | |
120 | - /** |
|
121 | - * Checks whether the given user is allowed to assign/unassign the tag with the |
|
122 | - * given id. |
|
123 | - * |
|
124 | - * @param ISystemTag $tag tag to check permission for |
|
125 | - * @param IUser $user user to check permission for |
|
126 | - * |
|
127 | - * @return true if the user is allowed to assign/unassign the tag, false otherwise |
|
128 | - * |
|
129 | - * @since 9.1.0 |
|
130 | - */ |
|
131 | - public function canUserAssignTag(ISystemTag $tag, IUser $user); |
|
120 | + /** |
|
121 | + * Checks whether the given user is allowed to assign/unassign the tag with the |
|
122 | + * given id. |
|
123 | + * |
|
124 | + * @param ISystemTag $tag tag to check permission for |
|
125 | + * @param IUser $user user to check permission for |
|
126 | + * |
|
127 | + * @return true if the user is allowed to assign/unassign the tag, false otherwise |
|
128 | + * |
|
129 | + * @since 9.1.0 |
|
130 | + */ |
|
131 | + public function canUserAssignTag(ISystemTag $tag, IUser $user); |
|
132 | 132 | |
133 | - /** |
|
134 | - * Checks whether the given user is allowed to see the tag with the given id. |
|
135 | - * |
|
136 | - * @param ISystemTag $tag tag to check permission for |
|
137 | - * @param IUser $user user to check permission for |
|
138 | - * |
|
139 | - * @return true if the user can see the tag, false otherwise |
|
140 | - * |
|
141 | - * @since 9.1.0 |
|
142 | - */ |
|
143 | - public function canUserSeeTag(ISystemTag $tag, IUser $userId); |
|
133 | + /** |
|
134 | + * Checks whether the given user is allowed to see the tag with the given id. |
|
135 | + * |
|
136 | + * @param ISystemTag $tag tag to check permission for |
|
137 | + * @param IUser $user user to check permission for |
|
138 | + * |
|
139 | + * @return true if the user can see the tag, false otherwise |
|
140 | + * |
|
141 | + * @since 9.1.0 |
|
142 | + */ |
|
143 | + public function canUserSeeTag(ISystemTag $tag, IUser $userId); |
|
144 | 144 | |
145 | - /** |
|
146 | - * Set groups that can assign a given tag. |
|
147 | - * |
|
148 | - * @param ISystemTag $tag tag for group assignment |
|
149 | - * @param string[] $groupIds group ids of groups that can assign/unassign the tag |
|
150 | - * |
|
151 | - * @since 9.1.0 |
|
152 | - */ |
|
153 | - public function setTagGroups(ISystemTag $tag, $groupIds); |
|
145 | + /** |
|
146 | + * Set groups that can assign a given tag. |
|
147 | + * |
|
148 | + * @param ISystemTag $tag tag for group assignment |
|
149 | + * @param string[] $groupIds group ids of groups that can assign/unassign the tag |
|
150 | + * |
|
151 | + * @since 9.1.0 |
|
152 | + */ |
|
153 | + public function setTagGroups(ISystemTag $tag, $groupIds); |
|
154 | 154 | |
155 | - /** |
|
156 | - * Get groups that can assign a given tag. |
|
157 | - * |
|
158 | - * @param ISystemTag $tag tag for group assignment |
|
159 | - * |
|
160 | - * @return string[] group ids of groups that can assign/unassign the tag |
|
161 | - * |
|
162 | - * @since 9.1.0 |
|
163 | - */ |
|
164 | - public function getTagGroups(ISystemTag $tag); |
|
155 | + /** |
|
156 | + * Get groups that can assign a given tag. |
|
157 | + * |
|
158 | + * @param ISystemTag $tag tag for group assignment |
|
159 | + * |
|
160 | + * @return string[] group ids of groups that can assign/unassign the tag |
|
161 | + * |
|
162 | + * @since 9.1.0 |
|
163 | + */ |
|
164 | + public function getTagGroups(ISystemTag $tag); |
|
165 | 165 | } |