1 | <?php |
||
15 | class Pinners extends Provider |
||
16 | { |
||
17 | use Searchable, Followable, HasFollowers; |
||
18 | |||
19 | protected $loginRequiredFor = ['follow', 'unFollow']; |
||
20 | |||
21 | protected $searchScope = 'people'; |
||
22 | protected $entityIdName = 'user_id'; |
||
23 | protected $followersFor = 'username'; |
||
24 | |||
25 | protected $followUrl = UrlHelper::RESOURCE_FOLLOW_USER; |
||
26 | protected $unFollowUrl = UrlHelper::RESOURCE_UNFOLLOW_USER; |
||
27 | protected $followersUrl = UrlHelper::RESOURCE_USER_FOLLOWERS; |
||
28 | |||
29 | /** |
||
30 | * Get user info. |
||
31 | * If username param is not specified, will |
||
32 | * return info for logged user. |
||
33 | * |
||
34 | * @param string $username |
||
35 | * |
||
36 | * @return null|array |
||
37 | */ |
||
38 | public function info($username) |
||
42 | |||
43 | /** |
||
44 | * Get pinner following other pinners. |
||
45 | * |
||
46 | * @param string $username |
||
47 | * @param int $limit |
||
48 | * |
||
49 | * @return Iterator |
||
50 | */ |
||
51 | public function following($username, $limit = 0) |
||
57 | |||
58 | /** |
||
59 | * Get pinner pins. |
||
60 | * |
||
61 | * @param string $username |
||
62 | * @param int $limit |
||
63 | * |
||
64 | * @return Iterator |
||
65 | */ |
||
66 | public function pins($username, $limit = 0) |
||
72 | |||
73 | /** |
||
74 | * Login as pinner. |
||
75 | * |
||
76 | * @param string $username |
||
77 | * @param string $password |
||
78 | * |
||
79 | * @throws AuthException |
||
80 | * |
||
81 | * @return bool |
||
82 | */ |
||
83 | public function login($username, $password) |
||
103 | |||
104 | public function logout() |
||
108 | |||
109 | /** |
||
110 | * Validates password and login. |
||
111 | * |
||
112 | * @param string $username |
||
113 | * @param string $password |
||
114 | */ |
||
115 | protected function checkCredentials($username, $password) |
||
121 | |||
122 | /** |
||
123 | * @param string $username |
||
124 | * @param string $url |
||
125 | * @param int $limit |
||
126 | * |
||
127 | * @return Iterator |
||
128 | */ |
||
129 | protected function paginate($username, $url, $limit) |
||
138 | } |
||
139 |