1 | <?php |
||
9 | class Pins extends Provider |
||
10 | { |
||
11 | use SearchTrait; |
||
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 integer $pinId |
||
27 | * @return bool |
||
28 | */ |
||
29 | public function like($pinId) |
||
33 | |||
34 | /** |
||
35 | * Removes your like from pin with current ID |
||
36 | * |
||
37 | * @param integer $pinId |
||
38 | * @return bool |
||
39 | */ |
||
40 | public function unLike($pinId) |
||
44 | |||
45 | /** |
||
46 | * Calls Pinterest API to like or unlike Pin by ID |
||
47 | * |
||
48 | * @param int $pinId |
||
49 | * @param string $resourceUrl |
||
50 | * @return bool |
||
51 | */ |
||
52 | protected function likePinMethodCall($pinId, $resourceUrl) |
||
56 | |||
57 | /** |
||
58 | * Write a comment for a pin with current id |
||
59 | * |
||
60 | * @param integer $pinId |
||
61 | * @param string $text Comment |
||
62 | * @return array|bool |
||
63 | */ |
||
64 | public function comment($pinId, $text) |
||
70 | |||
71 | /** |
||
72 | * Delete a comment for a pin with current id |
||
73 | * |
||
74 | * @param integer $pinId |
||
75 | * @param integer $commentId |
||
76 | * @return bool |
||
77 | */ |
||
78 | public function deleteComment($pinId, $commentId) |
||
84 | |||
85 | /** |
||
86 | * Create a pin. Returns created pin ID |
||
87 | * |
||
88 | * @param string $imageUrl |
||
89 | * @param int $boardId |
||
90 | * @param string $description |
||
91 | * @return bool|int |
||
92 | */ |
||
93 | public function create($imageUrl, $boardId, $description = "") |
||
105 | |||
106 | /** |
||
107 | * Make a repin |
||
108 | * |
||
109 | * @param int $repinId |
||
110 | * @param int $boardId |
||
111 | * @param string $description |
||
112 | * @return bool|int |
||
113 | */ |
||
114 | public function repin($repinId, $boardId, $description = "") |
||
126 | |||
127 | /** |
||
128 | * Delete a pin |
||
129 | * |
||
130 | * @param int $pinId |
||
131 | * @return bool |
||
132 | */ |
||
133 | public function delete($pinId) |
||
137 | |||
138 | /** |
||
139 | * Get information of a pin by PinID |
||
140 | * |
||
141 | * @param int $pinId |
||
142 | * @return array|bool |
||
143 | */ |
||
144 | public function info($pinId) |
||
159 | |||
160 | /** |
||
161 | * @return string |
||
162 | */ |
||
163 | protected function getScope() |
||
167 | } |
||
168 |