1 | <?php |
||
9 | class Pins extends Provider |
||
10 | { |
||
11 | use Searchable; |
||
12 | |||
13 | protected $loginRequired = [ |
||
14 | 'like', |
||
15 | 'unLike', |
||
16 | 'comment', |
||
17 | 'deleteComment', |
||
18 | 'create', |
||
19 | 'repin', |
||
20 | 'delete', |
||
21 | ]; |
||
22 | |||
23 | /** |
||
24 | * Likes pin with current ID. |
||
25 | * |
||
26 | * @param int $pinId |
||
27 | * |
||
28 | * @return bool |
||
29 | */ |
||
30 | public function like($pinId) |
||
34 | |||
35 | /** |
||
36 | * Removes your like from pin with current ID. |
||
37 | * |
||
38 | * @param int $pinId |
||
39 | * |
||
40 | * @return bool |
||
41 | */ |
||
42 | public function unLike($pinId) |
||
46 | |||
47 | /** |
||
48 | * Calls Pinterest API to like or unlike Pin by ID. |
||
49 | * |
||
50 | * @param int $pinId |
||
51 | * @param string $resourceUrl |
||
52 | * |
||
53 | * @return bool |
||
54 | */ |
||
55 | protected function likePinMethodCall($pinId, $resourceUrl) |
||
59 | |||
60 | /** |
||
61 | * Write a comment for a pin with current id. |
||
62 | * |
||
63 | * @param int $pinId |
||
64 | * @param string $text Comment |
||
65 | * |
||
66 | * @return array|bool |
||
67 | */ |
||
68 | public function comment($pinId, $text) |
||
74 | |||
75 | /** |
||
76 | * Delete a comment for a pin with current id. |
||
77 | * |
||
78 | * @param int $pinId |
||
79 | * @param int $commentId |
||
80 | * |
||
81 | * @return bool |
||
82 | */ |
||
83 | public function deleteComment($pinId, $commentId) |
||
89 | |||
90 | /** |
||
91 | * Create a pin. Returns created pin ID. |
||
92 | * |
||
93 | * @param string $imageUrl |
||
94 | * @param int $boardId |
||
95 | * @param string $description |
||
96 | * @param string $link |
||
97 | * |
||
98 | * @return bool|int |
||
99 | */ |
||
100 | public function create($imageUrl, $boardId, $description = '', $link = '') |
||
112 | |||
113 | /** |
||
114 | * Update pin by ID. You can move pin to a new board by setting this board id. |
||
115 | * |
||
116 | * @param int $pindId |
||
117 | * @param string $description |
||
118 | * @param string $link |
||
119 | * @param int|null $boardId |
||
120 | * @return mixed |
||
121 | */ |
||
122 | public function update($pindId, $description = '', $link = '', $boardId = null) |
||
133 | |||
134 | /** |
||
135 | * Make a repin. |
||
136 | * |
||
137 | * @param int $repinId |
||
138 | * @param int $boardId |
||
139 | * @param string $description |
||
140 | * |
||
141 | * @return bool|int |
||
142 | */ |
||
143 | public function repin($repinId, $boardId, $description = '') |
||
155 | |||
156 | /** |
||
157 | * Delete a pin. |
||
158 | * |
||
159 | * @param int $pinId |
||
160 | * |
||
161 | * @return bool |
||
162 | */ |
||
163 | public function delete($pinId) |
||
167 | |||
168 | /** |
||
169 | * Get information of a pin by PinID. |
||
170 | * |
||
171 | * @param int $pinId |
||
172 | * |
||
173 | * @return array|bool |
||
174 | */ |
||
175 | public function info($pinId) |
||
190 | |||
191 | /** |
||
192 | * @return string |
||
193 | */ |
||
194 | protected function getScope() |
||
198 | } |
||
199 |