1 | <?php |
||
16 | class Pinners extends Provider |
||
17 | { |
||
18 | use SearchTrait, FollowTrait, FollowersTrait; |
||
19 | |||
20 | protected $loginRequired = [ |
||
21 | 'follow', |
||
22 | 'unFollow' |
||
23 | ]; |
||
24 | |||
25 | /** |
||
26 | * Get user info. |
||
27 | * If username param is not specified, will |
||
28 | * return info for logged user |
||
29 | * |
||
30 | * @param string $username |
||
31 | * @return null|array |
||
32 | */ |
||
33 | public function info($username) |
||
40 | |||
41 | /** |
||
42 | * Get pinner followers |
||
43 | * |
||
44 | * @param string $username |
||
45 | * @param int $batchesLimit |
||
46 | * @return Iterator |
||
47 | */ |
||
48 | public function followers($username, $batchesLimit = 0) |
||
54 | |||
55 | /** |
||
56 | * Get pinner following other pinners |
||
57 | * |
||
58 | * @param string $username |
||
59 | * @param int $batchesLimit |
||
60 | * @return Iterator |
||
61 | */ |
||
62 | public function following($username, $batchesLimit = 0) |
||
68 | |||
69 | /** |
||
70 | * Get pinner pins |
||
71 | * |
||
72 | * @param string $username |
||
73 | * @param int $batchesLimit |
||
74 | * @return Iterator |
||
75 | */ |
||
76 | public function pins($username, $batchesLimit = 0) |
||
82 | |||
83 | /** |
||
84 | * Login as pinner |
||
85 | * |
||
86 | * @param string $username |
||
87 | * @param string $password |
||
88 | * @return bool |
||
89 | * @throws AuthException |
||
90 | */ |
||
91 | public function login($username, $password) |
||
111 | |||
112 | /** |
||
113 | * Validates password and login |
||
114 | * |
||
115 | * @param string $username |
||
116 | * @param string $password |
||
117 | */ |
||
118 | protected function checkCredentials($username, $password) |
||
124 | |||
125 | /** |
||
126 | * Search scope |
||
127 | * |
||
128 | * @return string |
||
129 | */ |
||
130 | protected function getScope() |
||
134 | |||
135 | protected function getEntityIdName() |
||
139 | |||
140 | /** |
||
141 | * Follow resource |
||
142 | * |
||
143 | * @return string |
||
144 | */ |
||
145 | protected function getFollowUrl() |
||
149 | |||
150 | /** |
||
151 | * UnFollow resource |
||
152 | * @return string |
||
153 | */ |
||
154 | protected function getUnfFollowUrl() |
||
158 | |||
159 | /** |
||
160 | * Wrapper over Pagination::getPaginatedData for |
||
161 | * high-level functions, such as 'following', 'pins' and others. |
||
162 | * |
||
163 | * @param string $username |
||
164 | * @param string $url |
||
165 | * @param string $sourceUrl |
||
166 | * @param integer $batchesLimit |
||
167 | * @return Iterator |
||
168 | */ |
||
169 | protected function getPaginatedData($username, $url, $sourceUrl, $batchesLimit) |
||
179 | } |
||
180 |