1 | <?php |
||
11 | class User extends Provider |
||
12 | { |
||
13 | use UploadsImages; |
||
14 | |||
15 | /** |
||
16 | * @var array |
||
17 | */ |
||
18 | protected $loginRequiredFor = [ |
||
19 | 'invite', |
||
20 | 'profile', |
||
21 | 'username', |
||
22 | 'isBanned', |
||
23 | 'deactivate', |
||
24 | 'sessionsHistory', |
||
25 | 'convertToBusiness', |
||
26 | ]; |
||
27 | |||
28 | /** |
||
29 | * Updates or returns user profile info. Gets associative array as a param. Available keys of array are: |
||
30 | * 'last_name', 'first_name', 'username', 'about', 'location' and 'website_url'. |
||
31 | * You can also change user avatar by passing 'profile_image'. |
||
32 | * |
||
33 | * @param array $userInfo If empty returns current user profile. |
||
34 | * |
||
35 | * @return bool|array|Profile |
||
36 | */ |
||
37 | public function profile($userInfo = null) |
||
44 | |||
45 | /** |
||
46 | * Checks if current user is banned |
||
47 | * |
||
48 | * @return bool |
||
49 | */ |
||
50 | public function isBanned() |
||
58 | |||
59 | /** |
||
60 | * Returns current user username |
||
61 | * |
||
62 | * @return string |
||
63 | */ |
||
64 | public function username() |
||
70 | |||
71 | /** |
||
72 | * Deactivates your account. |
||
73 | * |
||
74 | * @param string $reason |
||
75 | * @param string $explanation |
||
76 | * @return bool |
||
77 | */ |
||
78 | public function deactivate($reason = 'other', $explanation = '') |
||
92 | |||
93 | /** |
||
94 | * Send invite to email |
||
95 | * @param string $email |
||
96 | * @return bool|Response |
||
97 | */ |
||
98 | public function invite($email) |
||
107 | |||
108 | /** |
||
109 | * Remove things you’ve recently searched for from search suggestions. |
||
110 | * @return bool|Response |
||
111 | */ |
||
112 | public function clearSearchHistory() |
||
116 | |||
117 | /** |
||
118 | * Simply makes GET request to some url. |
||
119 | * @param string $url |
||
120 | * @return array|bool |
||
121 | */ |
||
122 | public function visitPage($url = '') |
||
126 | |||
127 | /** |
||
128 | * Get your account sessions history |
||
129 | * @return array |
||
130 | */ |
||
131 | public function sessionsHistory() |
||
135 | |||
136 | /** |
||
137 | * Get list of available locales |
||
138 | * @return array |
||
139 | */ |
||
140 | public function getLocales() |
||
144 | |||
145 | /** |
||
146 | * Get list of available countries |
||
147 | * @return array |
||
148 | */ |
||
149 | public function getCountries() |
||
153 | |||
154 | /** |
||
155 | * Get list of available account types |
||
156 | * @return array |
||
157 | */ |
||
158 | public function getAccountTypes() |
||
162 | |||
163 | /** |
||
164 | * @return array |
||
165 | */ |
||
166 | protected function getProfile() |
||
170 | |||
171 | /** |
||
172 | * @param array|Profile $userInfo |
||
173 | * @return bool|Response |
||
174 | */ |
||
175 | protected function updateProfile($userInfo) |
||
188 | } |
||
189 |