1 | <?php |
||
13 | class Cardlist extends AbstractApi |
||
14 | { |
||
15 | /** |
||
16 | * Base path of lists api |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $path = 'lists'; |
||
20 | |||
21 | /** |
||
22 | * List fields |
||
23 | * @link https://trello.com/docs/api/list/#get-1-lists-list-id-or-shortlink-field |
||
24 | * @var array |
||
25 | */ |
||
26 | public static $fields = array( |
||
27 | 'name', |
||
28 | 'closed', |
||
29 | 'idBoard', |
||
30 | 'pos', |
||
31 | 'subscribed', |
||
32 | ); |
||
33 | |||
34 | /** |
||
35 | * Find a list by id |
||
36 | * @link https://trello.com/docs/api/list/#get-1-lists-idlist |
||
37 | * |
||
38 | * @param string $id the list's id |
||
39 | * @param array $params optional attributes |
||
40 | * |
||
41 | * @return array list info |
||
42 | */ |
||
43 | 1 | public function show($id, array $params = array()) |
|
47 | |||
48 | /** |
||
49 | * Create a list |
||
50 | * @link https://trello.com/docs/api/list/#post-1-lists |
||
51 | * |
||
52 | * @param array $params Required attributes: 'name', 'idBoard' |
||
53 | * Optional attributes: 'pos' |
||
54 | * |
||
55 | * @return array |
||
56 | */ |
||
57 | 3 | public function create(array $params = array()) |
|
63 | |||
64 | /** |
||
65 | * Update a list |
||
66 | * @link https://trello.com/docs/api/list/#put-1-lists-idlist |
||
67 | * |
||
68 | * @param string $id the list's id |
||
69 | * @param array $params list attributes to update |
||
70 | * |
||
71 | * @return array list info |
||
72 | */ |
||
73 | 1 | public function update($id, array $params = array()) |
|
77 | |||
78 | /** |
||
79 | * Set a given list's board |
||
80 | * @link https://trello.com/docs/api/list/#put-1-lists-idlist-idboard |
||
81 | * |
||
82 | * @param string $id the list's id |
||
83 | * @param string $boardId the board's id |
||
84 | * |
||
85 | * @return array board info |
||
86 | */ |
||
87 | 1 | public function setBoard($id, $boardId) |
|
91 | |||
92 | /** |
||
93 | * Get a given list's board |
||
94 | * @link https://trello.com/docs/api/list/#get-1-lists-idlist-board |
||
95 | * |
||
96 | * @param string $id the list's id |
||
97 | * @param array $params optional parameters |
||
98 | * |
||
99 | * @return array board info |
||
100 | */ |
||
101 | 1 | public function getBoard($id, array $params = array()) |
|
105 | |||
106 | /** |
||
107 | * Get the field of a board of a given list |
||
108 | * @link https://trello.com/docs/api/list/#get-1-lists-idlist-board-field |
||
109 | * |
||
110 | * @param string $id the list's id |
||
111 | * @param array $field the name of the field |
||
112 | * |
||
113 | * @return array |
||
114 | * |
||
115 | * @throws InvalidArgumentException if the field does not exist |
||
116 | */ |
||
117 | 2 | public function getBoardField($id, $field) |
|
123 | |||
124 | /** |
||
125 | * Set a given list's name |
||
126 | * @link https://trello.com/docs/api/list/#put-1-lists-idlist-name |
||
127 | * |
||
128 | * @param string $id the list's id |
||
129 | * @param string $name the name |
||
130 | * |
||
131 | * @return array list info |
||
132 | */ |
||
133 | 1 | public function setName($id, $name) |
|
137 | |||
138 | /** |
||
139 | * Set a given list's description |
||
140 | * @link https://trello.com/docs/api/list/#put-1-lists-list-id-desc |
||
141 | * |
||
142 | * @param string $id the list's id |
||
143 | * @param bool $subscribed subscription state |
||
144 | * |
||
145 | * @return array list info |
||
146 | */ |
||
147 | 1 | public function setSubscribed($id, $subscribed) |
|
151 | |||
152 | /** |
||
153 | * Set a given list's state |
||
154 | * @link https://trello.com/docs/api/list/#put-1-lists-idlist-closed |
||
155 | * |
||
156 | * @param string $id the list's id |
||
157 | * @param bool $closed whether the list should be closed or not |
||
158 | * |
||
159 | * @return array list info |
||
160 | */ |
||
161 | 1 | public function setClosed($id, $closed = true) |
|
165 | |||
166 | /** |
||
167 | * Set a given list's position |
||
168 | * @link https://trello.com/docs/api/list/#put-1-lists-idlist-pos |
||
169 | * |
||
170 | * @param string $id the list's id |
||
171 | * @param string|integer $position the position, eg. 'top', 'bottom' |
||
172 | * or a positive number |
||
173 | * |
||
174 | * @return array list info |
||
175 | */ |
||
176 | 1 | public function setPosition($id, $position) |
|
180 | |||
181 | /** |
||
182 | * Actions API |
||
183 | * |
||
184 | * @return Cardlist\Actions |
||
185 | */ |
||
186 | 1 | public function actions() |
|
190 | |||
191 | /** |
||
192 | * Cards API |
||
193 | * |
||
194 | * @return Cardlist\Cards |
||
195 | */ |
||
196 | 1 | public function cards() |
|
200 | } |
||
201 |