1 | <?php |
||
13 | class Boards extends Provider |
||
14 | { |
||
15 | use SearchTrait, FollowTrait, FollowersTrait; |
||
16 | |||
17 | protected $loginRequired = [ |
||
18 | 'delete', |
||
19 | 'create', |
||
20 | 'follow', |
||
21 | 'unFollow' |
||
22 | ]; |
||
23 | |||
24 | /** |
||
25 | * Get boards for user by username |
||
26 | * |
||
27 | * @param string $username |
||
28 | * @return array|bool |
||
29 | */ |
||
30 | public function forUser($username) |
||
36 | |||
37 | /** |
||
38 | * Get info about user's board |
||
39 | * |
||
40 | * @param string $username |
||
41 | * @param string $board |
||
42 | * @return array|bool |
||
43 | */ |
||
44 | public function info($username, $board) |
||
58 | |||
59 | /** |
||
60 | * Get pins from board by boardId |
||
61 | * |
||
62 | * @param int $boardId |
||
63 | * @param int $batchesLimit |
||
64 | * @return Iterator |
||
65 | */ |
||
66 | public function pins($boardId, $batchesLimit = 0) |
||
75 | |||
76 | /** |
||
77 | * Low-level function to get pins from board by its Id. |
||
78 | * Is used in getPaginatedData as callback. |
||
79 | * |
||
80 | * @param int $boardId |
||
81 | * @param array $bookmarks |
||
82 | * @return array|bool |
||
83 | */ |
||
84 | public function getPinsFromBoard($boardId, $bookmarks = []) |
||
92 | |||
93 | /** |
||
94 | * Run GET api request to boards resource |
||
95 | * |
||
96 | * @param array $query |
||
97 | * @param string $url |
||
98 | * @param bool $pagination |
||
99 | * @return array|bool |
||
100 | */ |
||
101 | protected function boardsGetCall($query, $url, $pagination = false) |
||
111 | |||
112 | /** |
||
113 | * Delete your board by ID |
||
114 | * |
||
115 | * @param int $boardId |
||
116 | * @return array|bool |
||
117 | */ |
||
118 | public function delete($boardId) |
||
122 | |||
123 | /** |
||
124 | * Create a new board |
||
125 | * |
||
126 | * @param string $name |
||
127 | * @param string $description |
||
128 | * @param string $privacy Can be 'public' or 'secret'. 'public' by default. |
||
129 | * @return array|bool |
||
130 | */ |
||
131 | public function create($name, $description, $privacy = 'public') |
||
141 | |||
142 | /** |
||
143 | * Get board followers |
||
144 | * |
||
145 | * @param $boardId |
||
146 | * @param int $batchesLimit |
||
147 | * @return Iterator |
||
148 | */ |
||
149 | public function followers($boardId, $batchesLimit = 0) |
||
155 | |||
156 | /** |
||
157 | * Search scope |
||
158 | * |
||
159 | * @return string |
||
160 | */ |
||
161 | protected function getScope() |
||
165 | |||
166 | protected function getEntityIdName() |
||
170 | |||
171 | /** |
||
172 | * Follow resource |
||
173 | * |
||
174 | * @return string |
||
175 | */ |
||
176 | protected function getFollowUrl() |
||
180 | |||
181 | /** |
||
182 | * UnFollow resource |
||
183 | * @return string |
||
184 | */ |
||
185 | protected function getUnfFollowUrl() |
||
189 | } |
||
190 |