1 | <?php |
||
13 | class Notification extends AbstractApi |
||
14 | { |
||
15 | /** |
||
16 | * Base path of notifications api |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $path = 'notifications'; |
||
20 | |||
21 | /** |
||
22 | * Notification fields |
||
23 | * @link https://trello.com/docs/api/notification/#get-1-notifications-idnotification-field |
||
24 | * @var array |
||
25 | */ |
||
26 | public static $fields = array( |
||
27 | 'unread', |
||
28 | 'type', |
||
29 | 'date', |
||
30 | 'data', |
||
31 | 'idMemberCreator', |
||
32 | ); |
||
33 | |||
34 | /** |
||
35 | * Find a notification by id |
||
36 | * @link https://trello.com/docs/api/notification/#get-1-notifications-idnotification |
||
37 | * |
||
38 | * @param string $id the notification's id |
||
39 | * @param array $params optional attributes |
||
40 | * |
||
41 | * @return array |
||
42 | */ |
||
43 | 1 | public function show($id, array $params = array()) |
|
47 | |||
48 | /** |
||
49 | * Update a notification |
||
50 | * @link https://trello.com/docs/api/notification/#put-1-notifications-idnotification |
||
51 | * |
||
52 | * @param string $id the notification's id |
||
53 | * @param array $data attributes to update |
||
54 | * |
||
55 | * @return arrays |
||
56 | */ |
||
57 | 1 | public function update($id, array $data) |
|
61 | |||
62 | /** |
||
63 | * Set a notification's unread status |
||
64 | * @link https://trello.com/docs/api/notification/#put-1-notifications-idnotification-unread |
||
65 | * |
||
66 | * @param string $id the notification's id |
||
67 | * @param bool $status true for unread, false for read |
||
68 | * |
||
69 | * @return arrays |
||
70 | */ |
||
71 | 1 | public function setUnread($id, $status) |
|
75 | |||
76 | /** |
||
77 | * Set all notification's as read |
||
78 | * @link https://trello.com/docs/api/notification/#put-1-notifications-idnotification-unread |
||
79 | * |
||
80 | * @return array |
||
81 | */ |
||
82 | 1 | public function setAllRead() |
|
86 | |||
87 | /** |
||
88 | * Get a given notification's entities |
||
89 | * @link https://trello.com/docs/api/notification/#get-1-notifications-notification-id-entities |
||
90 | * |
||
91 | * @param string $id the notification's id |
||
92 | * @param array $params optional parameters |
||
93 | * |
||
94 | * @return array |
||
95 | */ |
||
96 | 1 | public function getEntities($id, array $params = array()) |
|
100 | |||
101 | /** |
||
102 | * Get a notification's board |
||
103 | * @link https://trello.com/docs/api/notification/#get-1-notifications-idnotification-board |
||
104 | * |
||
105 | * @param string $id the notification's id |
||
106 | * @param array $params optional parameters |
||
107 | * |
||
108 | * @return array |
||
109 | */ |
||
110 | 1 | public function getBoard($id, array $params = array()) |
|
114 | |||
115 | /** |
||
116 | * Get the field of a board of a given card |
||
117 | * @link https://trello.com/docs/api/notification/#get-1-notifications-idnotification-board |
||
118 | * |
||
119 | * @param string $id the notification's id |
||
120 | * @param array $field the name of the field |
||
121 | * |
||
122 | * @return array |
||
123 | * |
||
124 | * @throws InvalidArgumentException if the field does not exist |
||
125 | */ |
||
126 | 2 | public function getBoardField($id, $field) |
|
132 | |||
133 | /** |
||
134 | * Get a notification's list |
||
135 | * @link https://trello.com/docs/api/notification/#get-1-notifications-idnotification-list |
||
136 | * |
||
137 | * @param string $id the notification's id |
||
138 | * @param array $params optional parameters |
||
139 | * |
||
140 | * @return array |
||
141 | */ |
||
142 | 1 | public function getList($id, array $params = array()) |
|
146 | |||
147 | /** |
||
148 | * Get the field of a list of a given notification |
||
149 | * @link https://trello.com/docs/api/notification/index.html#get-1-notifications-idnotification-list-field |
||
150 | * |
||
151 | * @param string $id the notification's id |
||
152 | * @param array $field the name of the field |
||
153 | * |
||
154 | * @return array |
||
155 | * |
||
156 | * @throws InvalidArgumentException if the field does not exist |
||
157 | */ |
||
158 | 2 | public function getListField($id, $field) |
|
164 | |||
165 | /** |
||
166 | * Get a notification's card |
||
167 | * @link https://trello.com/docs/api/notification/#get-1-notifications-idnotification-card |
||
168 | * |
||
169 | * @param string $id the notification's id |
||
170 | * @param array $params optional parameters |
||
171 | * |
||
172 | * @return array |
||
173 | */ |
||
174 | 1 | public function getCard($id, array $params = array()) |
|
178 | |||
179 | /** |
||
180 | * Get the field of a card of a given notification |
||
181 | * @link https://trello.com/docs/api/notification/index.html#get-1-notifications-idnotification-card-field |
||
182 | * |
||
183 | * @param string $id the notification's id |
||
184 | * @param array $field the name of the field |
||
185 | * |
||
186 | * @return array |
||
187 | * |
||
188 | * @throws InvalidArgumentException if the field does not exist |
||
189 | */ |
||
190 | 2 | public function getCardField($id, $field) |
|
196 | |||
197 | /** |
||
198 | * Get a notification's member |
||
199 | * @link https://trello.com/docs/api/notification/#get-1-notifications-idnotification-member |
||
200 | * |
||
201 | * @param string $id the notification's id |
||
202 | * @param array $params optional parameters |
||
203 | * |
||
204 | * @return array |
||
205 | */ |
||
206 | 1 | public function getMember($id, array $params = array()) |
|
210 | |||
211 | /** |
||
212 | * Get the field of a member of a given notification |
||
213 | * @link https://trello.com/docs/api/notification/#get-1-notifications-idnotification-member-field |
||
214 | * |
||
215 | * @param string $id the notification's id |
||
216 | * @param array $field the name of the field |
||
217 | * |
||
218 | * @return array |
||
219 | * |
||
220 | * @throws InvalidArgumentException if the field does not exist |
||
221 | */ |
||
222 | 2 | public function getMemberField($id, $field) |
|
228 | |||
229 | /** |
||
230 | * Get a notification's creator |
||
231 | * @link https://trello.com/docs/api/notification/#get-1-notifications-idnotification-creator |
||
232 | * |
||
233 | * @param string $id the notification's id |
||
234 | * @param array $params optional parameters |
||
235 | * |
||
236 | * @return array |
||
237 | */ |
||
238 | 1 | public function getCreator($id, array $params = array()) |
|
242 | |||
243 | /** |
||
244 | * Get the field of a creator of a given notification |
||
245 | * @link https://trello.com/docs/api/notification/#get-1-notifications-idnotification-creator-field |
||
246 | * |
||
247 | * @param string $id the notification's id |
||
248 | * @param array $field the name of the field |
||
249 | * |
||
250 | * @return array |
||
251 | * |
||
252 | * @throws InvalidArgumentException if the field does not exist |
||
253 | */ |
||
254 | 2 | public function getCreatorField($id, $field) |
|
260 | |||
261 | /** |
||
262 | * Get a notification's organization |
||
263 | * @link https://trello.com/docs/api/notification/#get-1-notifications-idnotification-organization |
||
264 | * |
||
265 | * @param string $id the notification's id |
||
266 | * @param array $params optional parameters |
||
267 | * |
||
268 | * @return array |
||
269 | */ |
||
270 | 1 | public function getOrganization($id, array $params = array()) |
|
274 | |||
275 | /** |
||
276 | * Get the field of an organization of a given notification |
||
277 | * @link https://trello.com/docs/api/notification/#get-1-notifications-idnotification-organization-field |
||
278 | * |
||
279 | * @param string $id the notification's id |
||
280 | * @param array $field the name of the field |
||
281 | * |
||
282 | * @return array |
||
283 | * |
||
284 | * @throws InvalidArgumentException if the field does not exist |
||
285 | */ |
||
286 | 2 | public function getOrganizationField($id, $field) |
|
292 | } |
||
293 |