1 | <?php |
||
11 | class User extends Provider |
||
12 | { |
||
13 | use UploadsImages; |
||
14 | |||
15 | /** |
||
16 | * @var array |
||
17 | */ |
||
18 | protected $loginRequiredFor = [ |
||
19 | 'id', |
||
20 | 'invite', |
||
21 | 'profile', |
||
22 | 'username', |
||
23 | 'isBanned', |
||
24 | 'deactivate', |
||
25 | 'sessionsHistory', |
||
26 | 'convertToBusiness', |
||
27 | ]; |
||
28 | |||
29 | /** |
||
30 | * Updates or returns user profile info. Gets associative array as a param. Available keys of array are: |
||
31 | * 'last_name', 'first_name', 'username', 'about', 'location' and 'website_url'. |
||
32 | * You can also change user avatar by passing 'profile_image'. |
||
33 | * |
||
34 | * @param array $userInfo If empty returns current user profile. |
||
35 | * |
||
36 | * @return bool|array|Profile |
||
37 | */ |
||
38 | public function profile($userInfo = null) |
||
45 | |||
46 | /** |
||
47 | * Checks if current user is banned |
||
48 | * |
||
49 | * @return bool |
||
50 | */ |
||
51 | public function isBanned() |
||
59 | |||
60 | /** |
||
61 | * Returns current user username |
||
62 | * |
||
63 | * @return string |
||
64 | */ |
||
65 | public function username() |
||
69 | |||
70 | /** |
||
71 | * Returns current user id |
||
72 | * |
||
73 | * @return string |
||
74 | */ |
||
75 | public function id() |
||
79 | |||
80 | /** |
||
81 | * Deactivates your account. |
||
82 | * |
||
83 | * @param string $reason |
||
84 | * @param string $explanation |
||
85 | * @return bool |
||
86 | */ |
||
87 | public function deactivate($reason = 'other', $explanation = '') |
||
101 | |||
102 | /** |
||
103 | * Send invite to email |
||
104 | * @param string $email |
||
105 | * @return bool|Response |
||
106 | */ |
||
107 | public function invite($email) |
||
116 | |||
117 | /** |
||
118 | * Remove things you’ve recently searched for from search suggestions. |
||
119 | * @return bool|Response |
||
120 | */ |
||
121 | public function clearSearchHistory() |
||
125 | |||
126 | /** |
||
127 | * Simply makes GET request to some url. |
||
128 | * @param string $url |
||
129 | * @return array|bool |
||
130 | */ |
||
131 | public function visitPage($url = '') |
||
135 | |||
136 | /** |
||
137 | * Get your account sessions history |
||
138 | * @return array |
||
139 | */ |
||
140 | public function sessionsHistory() |
||
144 | |||
145 | /** |
||
146 | * Get list of available locales |
||
147 | * @return array |
||
148 | */ |
||
149 | public function getLocales() |
||
153 | |||
154 | /** |
||
155 | * Get list of available countries |
||
156 | * @return array |
||
157 | */ |
||
158 | public function getCountries() |
||
162 | |||
163 | /** |
||
164 | * Get list of available account types |
||
165 | * @return array |
||
166 | */ |
||
167 | public function getAccountTypes() |
||
171 | |||
172 | /** |
||
173 | * @return array |
||
174 | */ |
||
175 | protected function getProfile() |
||
179 | |||
180 | /** |
||
181 | * @param array|Profile $userInfo |
||
182 | * @return bool|Response |
||
183 | */ |
||
184 | protected function updateProfile($userInfo) |
||
197 | |||
198 | /** |
||
199 | * @param string $key |
||
200 | * @return mixed|string |
||
201 | */ |
||
202 | protected function getProfileData($key) |
||
208 | } |
||
209 |