1 | <?php |
||
5 | class PinHelper extends RequestHelper |
||
6 | { |
||
7 | /** |
||
8 | * Create Pinterest API request form commenting pin |
||
9 | * |
||
10 | * @param int $pinId |
||
11 | * @param string $text |
||
12 | * @return array |
||
13 | */ |
||
14 | public static function createCommentRequest($pinId, $text) |
||
21 | |||
22 | /** |
||
23 | * Create Pinterest API request form commenting pin |
||
24 | * |
||
25 | * @param int $pinId |
||
26 | * @param int $commentId |
||
27 | * @return array |
||
28 | */ |
||
29 | public static function createCommentDeleteRequest($pinId, $commentId) |
||
36 | |||
37 | /** |
||
38 | * Checks result of PIN-methods |
||
39 | * |
||
40 | * @param array $res |
||
41 | * @return bool |
||
42 | */ |
||
43 | public static function checkMethodCallResult($res) |
||
51 | |||
52 | /** |
||
53 | * Creates Pinterest API request for Pin creation |
||
54 | * |
||
55 | * @param string $description |
||
56 | * @param string $imageUrl |
||
57 | * @param int $boardId |
||
58 | * @return array |
||
59 | */ |
||
60 | public static function createPinCreationRequest($imageUrl, $boardId, $description = "") |
||
75 | |||
76 | |||
77 | /** |
||
78 | * Creates Pinterest API request for Pin repin |
||
79 | * |
||
80 | * @param string $description |
||
81 | * @param int $repinId |
||
82 | * @param int $boardId |
||
83 | * @return array |
||
84 | */ |
||
85 | public static function createRepinRequest($repinId, $boardId, $description) |
||
100 | |||
101 | |||
102 | /** |
||
103 | * Creates Pinterest API request to get Pin info |
||
104 | * |
||
105 | * @param int $pinId |
||
106 | * @return array |
||
107 | */ |
||
108 | public static function createInfoRequest($pinId) |
||
123 | |||
124 | /** |
||
125 | * Creates common pin request data by PinId |
||
126 | * |
||
127 | * @param int $pinId |
||
128 | * @param string $template |
||
129 | * @return array |
||
130 | */ |
||
131 | public static function createPinRequest($pinId, $template = 'id') |
||
140 | |||
141 | /** |
||
142 | * Creates simple Pin request by PinId (used by delete and like requests) |
||
143 | * |
||
144 | * @param $pinId |
||
145 | * @return array |
||
146 | */ |
||
147 | public static function createSimplePinRequest($pinId) |
||
152 | |||
153 | /** |
||
154 | * @param string|null $sourceUrl |
||
155 | * @param array $data |
||
156 | * @return array |
||
157 | */ |
||
158 | public static function createPinRequestData($data, $sourceUrl = null) |
||
167 | } |
||
168 |