1 | <?php |
||
13 | class Items extends AbstractApi |
||
14 | { |
||
15 | protected $path = 'checklists/#id#/checkItems'; |
||
16 | |||
17 | public static $fields = array( |
||
18 | 'name', |
||
19 | 'nameData', |
||
20 | 'type', |
||
21 | 'pos', |
||
22 | 'state', |
||
23 | ); |
||
24 | |||
25 | /** |
||
26 | * Get items related to a given checklist |
||
27 | * @link https://trello.com/docs/api/checklist/#get-1-checklists-idchecklist-checkitems |
||
28 | * |
||
29 | * @param string $id the card's id or short link |
||
30 | * @param array $params optional parameters |
||
31 | * |
||
32 | * @return array |
||
33 | */ |
||
34 | 1 | public function all($id, array $params = array()) |
|
38 | |||
39 | /** |
||
40 | * Create an item in the given checklist |
||
41 | * @link https://trello.com/docs/api/checklist/#post-1-checklists-idchecklist-checkitems |
||
42 | * |
||
43 | * @param string $id Id of the checklist |
||
44 | * @param string $name Name of the item |
||
45 | * @param bool $checked Check status |
||
46 | * @param array $data optional attributes |
||
47 | * |
||
48 | * @return array |
||
49 | */ |
||
50 | 2 | public function create($id, $name, $checked = false, array $data = array()) |
|
57 | |||
58 | /** |
||
59 | * Update an item in the given checklist |
||
60 | * |
||
61 | * FIXME |
||
62 | * There is no put method on checklist items, so this is |
||
63 | * a dirty workaround which works by deleting the item |
||
64 | * and recreating it. |
||
65 | * |
||
66 | * @param string $id Id of the checklist |
||
67 | * @param string $itemId the id of the item to update |
||
68 | * @param array $data check item data |
||
69 | * |
||
70 | * @return array |
||
71 | */ |
||
72 | 1 | public function update($id, $itemId, array $data) |
|
80 | |||
81 | /** |
||
82 | * Remove an item from checklist |
||
83 | * @link https://trello.com/docs/api/checklist/#delete-1-checklists-idchecklist-checkitems-idcheckitem |
||
84 | * |
||
85 | * @param string $id the id of the checklist the item should be removed from |
||
86 | * @param string $itemId the id of the item to delete |
||
87 | * |
||
88 | * @return array card info |
||
89 | */ |
||
90 | 2 | public function remove($id, $itemId) |
|
94 | } |
||
95 |