File tree Expand file tree Collapse file tree 4 files changed +89
-0
lines changed Expand file tree Collapse file tree 4 files changed +89
-0
lines changed Original file line number Diff line number Diff line change @@ -336,4 +336,14 @@ public function powerUps()
336336 {
337337 return new Board \PowerUps ($ this ->client );
338338 }
339+
340+ /**
341+ * Board CustomFields API
342+ *
343+ * @return Board\CustomFields
344+ */
345+ public function customFields ()
346+ {
347+ return new Board \CustomFields ($ this ->client );
348+ }
339349}
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Trello \Api \Board ;
4+
5+ use Trello \Api \AbstractApi ;
6+
7+ /**
8+ * Trello Board custom fields API
9+ * @link https://developers.trello.com/docs/getting-started-custom-fields
10+ *
11+ */
12+ class CustomFields extends AbstractApi
13+ {
14+ /**
15+ * Base path of board custom fields api
16+ * @var string
17+ */
18+ protected $ path = 'boards/#id#/customFields ' ;
19+
20+ /**
21+ * Get custom fields related to a given board
22+ * @link https://developers.trello.com/docs/getting-started-custom-fields#section-get-custom-fields-on-a-board
23+ *
24+ * @param string $id the board's
25+ * @param array $params optional parameters
26+ *
27+ * @return array
28+ */
29+ public function all ($ id , array $ params = array ())
30+ {
31+ return $ this ->get ($ this ->getPath ($ id ), $ params );
32+ }
33+ }
Original file line number Diff line number Diff line change @@ -517,4 +517,14 @@ public function stickers()
517517 {
518518 return new Card \Stickers ($ this ->client );
519519 }
520+
521+ /**
522+ * CustomFieldItems API
523+ *
524+ * @return Card\CustomFieldItems
525+ */
526+ public function customFieldItems ()
527+ {
528+ return new Card \CustomFieldItems ($ this ->client );
529+ }
520530}
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Trello \Api \Card ;
4+
5+ use Trello \Api \AbstractApi ;
6+
7+ /**
8+ * Trello Card custom fields items API
9+ * @link https://developers.trello.com/docs/getting-started-custom-fields#section-custom-field-values-on-cards
10+ *
11+ */
12+ class CustomFieldItems extends AbstractApi
13+ {
14+ /**
15+ * Base path of cards api
16+ * @var string
17+ */
18+ protected $ path = 'cards/#id#/ ' ;
19+
20+ /**
21+ * Get custom fiedls items related to a given card
22+ * @link https://developers.trello.com/docs/getting-started-custom-fields#section-getting-customfielditems-for-cards
23+ *
24+ * @param string $id the card's id or short link
25+ * @param array $params optional parameters
26+ *
27+ * @return array
28+ */
29+ public function all ($ id , array $ params = array ())
30+ {
31+ $ params = array_merge ($ params , array ('customFieldItems ' => 'true ' ));
32+ $ data = $ this ->get ($ this ->getPath ($ id ), $ params );
33+
34+ return array_key_exists ('customFieldItems ' , $ data ) ? $ data ['customFieldItems ' ] : array ();
35+ }
36+ }
You can’t perform that action at this time.
0 commit comments