1 | <?php |
||
15 | class Pinners extends Provider |
||
16 | { |
||
17 | use SearchTrait, FollowTrait, FollowersTrait; |
||
18 | |||
19 | protected $loginRequired = [ |
||
20 | 'follow', |
||
21 | 'unFollow' |
||
22 | ]; |
||
23 | |||
24 | /** |
||
25 | * Get user info. |
||
26 | * If username param is not specified, will |
||
27 | * return info for logged user |
||
28 | * |
||
29 | * @param string $username |
||
30 | * @return null|array |
||
31 | */ |
||
32 | public function info($username) |
||
39 | |||
40 | /** |
||
41 | * Get pinner followers |
||
42 | * |
||
43 | * @param string $username |
||
44 | * @param int $batchesLimit |
||
45 | * @return Iterator |
||
46 | */ |
||
47 | public function followers($username, $batchesLimit = 0) |
||
53 | |||
54 | /** |
||
55 | * Get pinner following other pinners |
||
56 | * |
||
57 | * @param string $username |
||
58 | * @param int $batchesLimit |
||
59 | * @return Iterator |
||
60 | */ |
||
61 | public function following($username, $batchesLimit = 0) |
||
67 | |||
68 | /** |
||
69 | * Get pinner pins |
||
70 | * |
||
71 | * @param string $username |
||
72 | * @param int $batchesLimit |
||
73 | * @return Iterator |
||
74 | */ |
||
75 | public function pins($username, $batchesLimit = 0) |
||
81 | |||
82 | /** |
||
83 | * Login as pinner |
||
84 | * |
||
85 | * @param string $username |
||
86 | * @param string $password |
||
87 | * @return bool |
||
88 | */ |
||
89 | public function login($username, $password) |
||
107 | |||
108 | /** |
||
109 | * Validates password and login |
||
110 | * |
||
111 | * @param string $username |
||
112 | * @param string $password |
||
113 | */ |
||
114 | protected function checkCredentials($username, $password) |
||
120 | |||
121 | /** |
||
122 | * Search scope |
||
123 | * |
||
124 | * @return string |
||
125 | */ |
||
126 | protected function getScope() |
||
130 | |||
131 | protected function getEntityIdName() |
||
135 | |||
136 | /** |
||
137 | * Follow resource |
||
138 | * |
||
139 | * @return string |
||
140 | */ |
||
141 | protected function getFollowUrl() |
||
145 | |||
146 | /** |
||
147 | * UnFollow resource |
||
148 | * @return string |
||
149 | */ |
||
150 | protected function getUnfFollowUrl() |
||
154 | |||
155 | /** |
||
156 | * Wrapper over Pagination::getPaginatedData for |
||
157 | * high-level functions, such as 'following', 'pins' and others. |
||
158 | * |
||
159 | * @param string $username |
||
160 | * @param string $url |
||
161 | * @param string $sourceUrl |
||
162 | * @param integer $batchesLimit |
||
163 | * @return Iterator |
||
164 | */ |
||
165 | protected function getPaginatedData($username, $url, $sourceUrl, $batchesLimit) |
||
175 | } |
||
176 |