1 | <?php |
||
10 | class Pins extends Provider |
||
11 | { |
||
12 | use Searchable; |
||
13 | |||
14 | protected $loginRequired = [ |
||
15 | 'like', |
||
16 | 'unLike', |
||
17 | 'comment', |
||
18 | 'deleteComment', |
||
19 | 'create', |
||
20 | 'repin', |
||
21 | 'delete', |
||
22 | 'activity' |
||
23 | ]; |
||
24 | |||
25 | /** |
||
26 | * Likes pin with current ID. |
||
27 | * |
||
28 | * @param int $pinId |
||
29 | * |
||
30 | * @return bool |
||
31 | */ |
||
32 | public function like($pinId) |
||
36 | |||
37 | /** |
||
38 | * Removes your like from pin with current ID. |
||
39 | * |
||
40 | * @param int $pinId |
||
41 | * |
||
42 | * @return bool |
||
43 | */ |
||
44 | public function unLike($pinId) |
||
48 | |||
49 | /** |
||
50 | * Calls Pinterest API to like or unlike Pin by ID. |
||
51 | * |
||
52 | * @param int $pinId |
||
53 | * @param string $resourceUrl |
||
54 | * |
||
55 | * @return bool |
||
56 | */ |
||
57 | protected function likePinMethodCall($pinId, $resourceUrl) |
||
61 | |||
62 | /** |
||
63 | * Write a comment for a pin with current id. |
||
64 | * |
||
65 | * @param int $pinId |
||
66 | * @param string $text Comment |
||
67 | * |
||
68 | * @return array|bool |
||
69 | */ |
||
70 | public function comment($pinId, $text) |
||
76 | |||
77 | /** |
||
78 | * Delete a comment for a pin with current id. |
||
79 | * |
||
80 | * @param int $pinId |
||
81 | * @param int $commentId |
||
82 | * |
||
83 | * @return bool |
||
84 | */ |
||
85 | public function deleteComment($pinId, $commentId) |
||
91 | |||
92 | /** |
||
93 | * Create a pin. Returns created pin ID. |
||
94 | * |
||
95 | * @param string $imageUrl |
||
96 | * @param int $boardId |
||
97 | * @param string $description |
||
98 | * @param string $link |
||
99 | * |
||
100 | * @return bool|int |
||
101 | */ |
||
102 | public function create($imageUrl, $boardId, $description = '', $link = '') |
||
114 | |||
115 | /** |
||
116 | * Edit pin by ID. You can move pin to a new board by setting this board id. |
||
117 | * |
||
118 | * @param int $pindId |
||
119 | * @param string $description |
||
120 | * @param string $link |
||
121 | * @param int|null $boardId |
||
122 | * @return mixed |
||
123 | */ |
||
124 | public function edit($pindId, $description = '', $link = '', $boardId = null) |
||
135 | |||
136 | /** |
||
137 | * Moves pin to a new board |
||
138 | * |
||
139 | * @param int $pindId |
||
140 | * @param int $boardId |
||
141 | * @return mixed |
||
142 | */ |
||
143 | public function moveToBoard($pindId, $boardId) |
||
147 | |||
148 | /** |
||
149 | * Make a repin. |
||
150 | * |
||
151 | * @param int $repinId |
||
152 | * @param int $boardId |
||
153 | * @param string $description |
||
154 | * |
||
155 | * @return bool|int |
||
156 | */ |
||
157 | public function repin($repinId, $boardId, $description = '') |
||
169 | |||
170 | /** |
||
171 | * Delete a pin. |
||
172 | * |
||
173 | * @param int $pinId |
||
174 | * |
||
175 | * @return bool |
||
176 | */ |
||
177 | public function delete($pinId) |
||
181 | |||
182 | /** |
||
183 | * Get information of a pin by PinID. |
||
184 | * |
||
185 | * @param int $pinId |
||
186 | * |
||
187 | * @return array|bool |
||
188 | */ |
||
189 | public function info($pinId) |
||
198 | |||
199 | /** |
||
200 | * Get pins from a specific url. For example: https://pinterest.com/source/flickr.com/ will return |
||
201 | * recent Pins from flickr.com |
||
202 | * |
||
203 | * @param string $source |
||
204 | * @param int $limit |
||
205 | * @return Iterator |
||
206 | */ |
||
207 | public function fromSource($source, $limit = 0) |
||
216 | |||
217 | /** |
||
218 | * @param $pinId |
||
219 | * @param int $limit |
||
220 | * @return Iterator |
||
221 | */ |
||
222 | public function activity($pinId, $limit = 0) |
||
237 | |||
238 | /** |
||
239 | * @return string |
||
240 | */ |
||
241 | protected function getScope() |
||
245 | } |
||
246 |