1 | <?php |
||
21 | class Board extends AbstractApi |
||
22 | { |
||
23 | /** |
||
24 | * Base path of boards api |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $path = 'boards'; |
||
28 | |||
29 | /** |
||
30 | * Board fields |
||
31 | * @link https://trello.com/docs/api/board/#get-1-boards-board-id-field |
||
32 | * @var array |
||
33 | */ |
||
34 | public static $fields = array( |
||
35 | 'name', |
||
36 | 'desc', |
||
37 | 'descData', |
||
38 | 'closed', |
||
39 | 'idOrganization', |
||
40 | 'invited', |
||
41 | 'pinned', |
||
42 | 'starred', |
||
43 | 'url', |
||
44 | 'prefs', |
||
45 | 'invitations', |
||
46 | 'memberships', |
||
47 | 'shortLink', |
||
48 | 'subscribed', |
||
49 | 'labelNames', |
||
50 | 'powerUps', |
||
51 | 'dateLastActivity', |
||
52 | 'dateLastView', |
||
53 | 'shortUrl', |
||
54 | ); |
||
55 | |||
56 | /** |
||
57 | * Find a board by id |
||
58 | * @link https://trello.com/docs/api/board/#get-1-boards-board-id |
||
59 | * |
||
60 | * @param string $id the board's id |
||
61 | * @param array $params optional attributes |
||
62 | * |
||
63 | * @return array board info |
||
64 | */ |
||
65 | 1 | public function show($id, array $params = array()) |
|
69 | |||
70 | /** |
||
71 | * Create a board |
||
72 | * @link https://trello.com/docs/api/board/#post-1-boards |
||
73 | * |
||
74 | * @param array $params attributes |
||
75 | * |
||
76 | * @return array board info |
||
77 | */ |
||
78 | 2 | public function create(array $params = array()) |
|
84 | |||
85 | /** |
||
86 | * Update a board |
||
87 | * @link https://trello.com/docs/api/board/#put-1-boards |
||
88 | * |
||
89 | * @param string $id the board's id |
||
90 | * @param array $params board attributes to update |
||
91 | * |
||
92 | * @return array |
||
93 | */ |
||
94 | 1 | public function update($id, array $params = array()) |
|
98 | |||
99 | /** |
||
100 | * Set a given board's name |
||
101 | * @link https://trello.com/docs/api/board/#put-1-boards-board-id-name |
||
102 | * |
||
103 | * @param string $id the board's id |
||
104 | * @param string $name the name |
||
105 | * |
||
106 | * @return array |
||
107 | */ |
||
108 | 1 | public function setName($id, $name) |
|
112 | |||
113 | /** |
||
114 | * Set a given board's description |
||
115 | * @link https://trello.com/docs/api/board/#put-1-boards-board-id-desc |
||
116 | * |
||
117 | * @param string $id the board's id |
||
118 | * @param string $description the description |
||
119 | * |
||
120 | * @return array |
||
121 | */ |
||
122 | 1 | public function setDescription($id, $description) |
|
126 | |||
127 | /** |
||
128 | * Set a given board's state |
||
129 | * @link https://trello.com/docs/api/board/#put-1-boards-board-id-closed |
||
130 | * |
||
131 | * @param string $id the board's id |
||
132 | * @param bool $closed whether the board should be closed or not |
||
133 | * |
||
134 | * @return array |
||
135 | */ |
||
136 | 1 | public function setClosed($id, $closed = true) |
|
140 | |||
141 | /** |
||
142 | * Set a given board's subscription state |
||
143 | * @link https://trello.com/docs/api/board/#put-1-boards-board-id-subscribed |
||
144 | * |
||
145 | * @param string $id the board's id |
||
146 | * @param bool $subscribed whether to subscribe to the board or not |
||
147 | * |
||
148 | * @return array |
||
149 | */ |
||
150 | 1 | public function setSubscribed($id, $subscribed = true) |
|
154 | |||
155 | /** |
||
156 | * Set a given board's organization |
||
157 | * @link https://trello.com/docs/api/board/#put-1-boards-board-id-organization |
||
158 | * |
||
159 | * @param string $id the board's id |
||
160 | * @param string $organizationId the organization's id |
||
161 | * |
||
162 | * @return array |
||
163 | */ |
||
164 | 1 | public function setOrganization($id, $organizationId) |
|
168 | |||
169 | /** |
||
170 | * Get a given board's organization |
||
171 | * @link https://trello.com/docs/api/board/#get-1-boards-board-id-organization |
||
172 | * |
||
173 | * @param string $id the board's id |
||
174 | * @param array $params optional parameters |
||
175 | * |
||
176 | * @return array |
||
177 | */ |
||
178 | 1 | public function getOrganization($id, array $params = array()) |
|
182 | |||
183 | /** |
||
184 | * Get the field of the organization of a given board |
||
185 | * @link https://trello.com/docs/api/board/#get-1-boards-board-id-organization-field |
||
186 | * |
||
187 | * @param string $id the board's id |
||
188 | * @param string $field the organization's field name |
||
189 | * |
||
190 | * @return array |
||
191 | */ |
||
192 | 2 | public function getOrganizationField($id, $field) |
|
198 | |||
199 | /** |
||
200 | * Get a given board's stars |
||
201 | * @link https://trello.com/docs/api/board/#get-1-boards-board-id-boardstars |
||
202 | * |
||
203 | * @param string $id the board's id |
||
204 | * @param array $params optional parameters |
||
205 | * |
||
206 | * @return array |
||
207 | */ |
||
208 | 1 | public function getStars($id, array $params = array()) |
|
212 | |||
213 | /** |
||
214 | * Get a given board's deltas |
||
215 | * @link https://trello.com/docs/api/board/index.html#get-1-boards-board-id-deltas |
||
216 | * |
||
217 | * @param string $id the board's id |
||
218 | * @param array $params optional parameters |
||
219 | * |
||
220 | * @return array |
||
221 | */ |
||
222 | 1 | public function getDeltas($id, array $params = array()) |
|
226 | |||
227 | /** |
||
228 | * Mark a given board as viewed |
||
229 | * @link https://trello.com/docs/api/board/#post-1-boards-board-id-markasviewed |
||
230 | * |
||
231 | * @param string $id the board's id |
||
232 | * |
||
233 | * @return array |
||
234 | */ |
||
235 | 1 | public function setViewed($id) |
|
239 | |||
240 | /** |
||
241 | * Board Actions API |
||
242 | * |
||
243 | * @return Board\Actions |
||
244 | */ |
||
245 | 1 | public function actions() |
|
249 | |||
250 | /** |
||
251 | * Board Lists API |
||
252 | * |
||
253 | * @return Board\Cardlists |
||
254 | */ |
||
255 | 1 | public function lists() |
|
259 | |||
260 | /** |
||
261 | * Board Cards API |
||
262 | * |
||
263 | * @return Board\Cards |
||
264 | */ |
||
265 | 1 | public function cards() |
|
269 | |||
270 | /** |
||
271 | * Board Checklists API |
||
272 | * |
||
273 | * @return Board\Checklists |
||
274 | */ |
||
275 | 1 | public function checklists() |
|
279 | |||
280 | /** |
||
281 | * Board Labels API |
||
282 | * |
||
283 | * @return Board\Labels |
||
284 | */ |
||
285 | 1 | public function labels() |
|
289 | |||
290 | /** |
||
291 | * Board Members API |
||
292 | * |
||
293 | * @return Board\Members |
||
294 | */ |
||
295 | 1 | public function members() |
|
299 | |||
300 | /** |
||
301 | * Board Memberships API |
||
302 | * |
||
303 | * @return Board\Memberships |
||
304 | */ |
||
305 | 1 | public function memberships() |
|
309 | |||
310 | /** |
||
311 | * Board Preferences API |
||
312 | * |
||
313 | * @return Board\Preferences |
||
314 | */ |
||
315 | 1 | public function preferences() |
|
319 | |||
320 | /** |
||
321 | * Board MyPreferences API |
||
322 | * |
||
323 | * @return Board\MyPreferences |
||
324 | */ |
||
325 | 1 | public function myPreferences() |
|
329 | |||
330 | /** |
||
331 | * Board PowerUps API |
||
332 | * |
||
333 | * @return Board\PowerUps |
||
334 | */ |
||
335 | 1 | public function powerUps() |
|
339 | } |
||
340 |