1 | <?php |
||
36 | class Circles { |
||
37 | |||
38 | const API_VERSION = [0, 9, 1]; |
||
39 | |||
40 | protected static function getContainer() { |
||
45 | |||
46 | |||
47 | /** |
||
48 | * Circles::version() |
||
49 | * |
||
50 | * returns the current version of the API |
||
51 | * |
||
52 | * @return int[] |
||
53 | */ |
||
54 | public static function version() { |
||
57 | |||
58 | |||
59 | /** |
||
60 | * Circles::createCircle(); |
||
61 | * |
||
62 | * Create a new circle and make the current user its owner. |
||
63 | * You must specify type and name. type is one of this value: |
||
64 | * |
||
65 | * CIRCLES_PERSONAL is 1 or 'personal' |
||
66 | * CIRCLES_HIDDEN is 2 or 'hidden' |
||
67 | * CIRCLES_PRIVATE is 4 or 'private' |
||
68 | * CIRCLES_PUBLIC is 8 or 'public' |
||
69 | * |
||
70 | * @param $type |
||
71 | * @param $name |
||
72 | * |
||
73 | * @return Circle |
||
74 | */ |
||
75 | public static function createCircle($type, $name) { |
||
81 | |||
82 | |||
83 | /** |
||
84 | * Circles::joinCircle(); |
||
85 | * |
||
86 | * This function will make the current user joining a circle identified by its Id. |
||
87 | * |
||
88 | * @param $circleId |
||
89 | * |
||
90 | * @return Member |
||
91 | */ |
||
92 | public static function joinCircle($circleId) { |
||
98 | |||
99 | |||
100 | /** |
||
101 | * Circles::leaveCircle(); |
||
102 | * |
||
103 | * This function will make the current user leaving the circle identified by its Id. Will fail |
||
104 | * if user is the owner of the circle. |
||
105 | * |
||
106 | * @param $circleId |
||
107 | * |
||
108 | * @return Member |
||
109 | */ |
||
110 | public static function leaveCircle($circleId) { |
||
116 | |||
117 | |||
118 | /** |
||
119 | * Circles::listCircles(); |
||
120 | * |
||
121 | * This function list all circles fitting a search regarding its name and the level and the |
||
122 | * rights from the current user. In case of Hidden circle, name needs to be complete so the |
||
123 | * circle is included in the list (or if the current user is the owner) |
||
124 | * |
||
125 | * example: Circles::listCircles(Circle::CIRCLES_ALL, '', 8, callback); will returns all |
||
126 | * circles when the current user is at least an Admin. |
||
127 | * |
||
128 | * @param $type |
||
129 | * @param string $name |
||
130 | * @param int $level |
||
131 | * |
||
132 | * @return Circle[] |
||
133 | */ |
||
134 | public static function listCircles($type, $name = '', $level = 0) { |
||
140 | |||
141 | |||
142 | /** |
||
143 | * Circles::detailsCircle(); |
||
144 | * |
||
145 | * WARNING - This function is called by the core - WARNING |
||
146 | * Do not change it |
||
147 | * |
||
148 | * Returns details on the circle. If the current user is a member, the members list will be |
||
149 | * return as well. |
||
150 | * |
||
151 | * @param $circleId |
||
152 | * |
||
153 | * @return Circle |
||
154 | */ |
||
155 | public static function detailsCircle($circleId) { |
||
161 | |||
162 | |||
163 | /** |
||
164 | * Circles::destroyCircle(); |
||
165 | * |
||
166 | * This function will destroy the circle if the current user is the Owner. |
||
167 | * |
||
168 | * @param $circleId |
||
169 | * |
||
170 | * @return mixed |
||
171 | */ |
||
172 | public static function destroyCircle($circleId) { |
||
178 | |||
179 | |||
180 | /** |
||
181 | * Circles::addMember(); |
||
182 | * |
||
183 | * This function will add a user as member of the circle. Current user need at least to be |
||
184 | * Moderator. |
||
185 | * |
||
186 | * @param $circleId |
||
187 | * @param $userId |
||
188 | * |
||
189 | * @return Member[] |
||
190 | */ |
||
191 | public static function addMember($circleId, $userId) { |
||
197 | |||
198 | |||
199 | /** |
||
200 | * Circles::getMember(); |
||
201 | * |
||
202 | * This function will return information on a member of the circle. Current user need at least |
||
203 | * to be Member. |
||
204 | * |
||
205 | * @param $circleId |
||
206 | * @param $userId |
||
207 | * |
||
208 | * @return Member |
||
209 | */ |
||
210 | public static function getMember($circleId, $userId) { |
||
216 | |||
217 | |||
218 | /** |
||
219 | * Circles::removeMember(); |
||
220 | * |
||
221 | * This function will remove a member from the circle. Current user needs to be at least |
||
222 | * Moderator and have a higher level that the targeted member. |
||
223 | * |
||
224 | * @param $circleId |
||
225 | * @param $userId |
||
226 | * |
||
227 | * @return Member[] |
||
228 | */ |
||
229 | public static function removeMember($circleId, $userId) { |
||
235 | |||
236 | |||
237 | /** |
||
238 | * Circles::levelMember(); |
||
239 | * |
||
240 | * Edit the level of a member of the circle. The current level of the target needs to be lower |
||
241 | * than the user that initiate the process (ie. the current user). The new level of the target |
||
242 | * cannot be the same than the current level of the user that initiate the process (ie. the |
||
243 | * current user). |
||
244 | * |
||
245 | * @param $circleId |
||
246 | * @param $userId |
||
247 | * @param $level |
||
248 | * |
||
249 | * @return Member[] |
||
250 | */ |
||
251 | public static function levelMember($circleId, $userId, $level) { |
||
257 | |||
258 | |||
259 | /** |
||
260 | * Circles::shareToCircle(); |
||
261 | * |
||
262 | * This function will share an item (array) to the circle identified by its Id. |
||
263 | * Source is the app that is sharing the item and type can be used by the app to identified the |
||
264 | * payload. |
||
265 | * |
||
266 | * @param $circleId |
||
267 | * @param $source |
||
268 | * @param $type |
||
269 | * @param array $payload |
||
270 | * @param $broadcaster |
||
271 | * |
||
272 | * @return mixed |
||
273 | */ |
||
274 | public static function shareToCircle( |
||
286 | |||
287 | |||
288 | /** |
||
289 | * Circles::linkCircle(); |
||
290 | * |
||
291 | * Initiate a link procedure. Current user must be at least Admin of the circle. |
||
292 | * circleId is the local circle and remote is the target for the link. |
||
293 | * Remote format is: <circle_name>@<remote_host> when remote_host must be a valid HTTPS address. |
||
294 | * |
||
295 | * @param $circleId |
||
296 | * @param $remote |
||
297 | * |
||
298 | * @return FederatedLink |
||
299 | */ |
||
300 | public static function linkCircle($circleId, $remote) { |
||
306 | |||
307 | |||
308 | /** |
||
309 | * Circles::generateLink(); |
||
310 | * |
||
311 | * Returns the link to get access to a local circle. |
||
312 | * |
||
313 | * @param int $circleId |
||
314 | * |
||
315 | * @return string |
||
316 | */ |
||
317 | public static function generateLink($circleId) { |
||
321 | |||
322 | |||
323 | /** |
||
324 | * Circles::generateLink(); |
||
325 | * |
||
326 | * Returns the link to get access to a remote circle. |
||
327 | * |
||
328 | * @param int $circleId |
||
329 | * |
||
330 | * @return string |
||
331 | */ |
||
332 | public static function generateRemoteLink($remote, $circleId) { |
||
336 | |||
337 | } |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.