1 | <?php |
||
10 | class User extends Provider |
||
11 | { |
||
12 | use UploadsImages; |
||
13 | |||
14 | protected $loginRequiredFor = ['profile', 'convertToBusiness']; |
||
15 | |||
16 | const REGISTRATION_COMPLETE_EXPERIENCE_ID = '11:10105'; |
||
17 | const ACCOUNT_TYPE_OTHER = 'other'; |
||
18 | |||
19 | /** |
||
20 | * Update user profile info. Gets associative array as a param. Available keys of array are: |
||
21 | * 'last_name', 'first_name', 'username', 'about', 'location' and 'website_url'. |
||
22 | * You can also change user avatar by passing 'profile_image'. |
||
23 | * |
||
24 | * @param array $userInfo |
||
25 | * |
||
26 | * @return mixed |
||
27 | */ |
||
28 | public function profile($userInfo) |
||
36 | |||
37 | /** |
||
38 | * Register a new user. |
||
39 | * |
||
40 | * @param string $email |
||
41 | * @param string $password |
||
42 | * @param string $name |
||
43 | * @param string $country |
||
44 | * @param int $age |
||
45 | * @return bool |
||
46 | */ |
||
47 | public function register($email, $password, $name, $country = "UK", $age = 18) |
||
60 | |||
61 | /** |
||
62 | * Register a new business account. |
||
63 | * |
||
64 | * @param string $email |
||
65 | * @param string $password |
||
66 | * @param string $businessName |
||
67 | * @param string $website |
||
68 | * @return bool|mixed |
||
69 | */ |
||
70 | public function registerBusiness($email, $password, $businessName, $website = '') |
||
82 | |||
83 | /** |
||
84 | * Convert your account to a business one. |
||
85 | * |
||
86 | * @param string $businessName |
||
87 | * @param string $websiteUrl |
||
88 | * @return mixed |
||
89 | */ |
||
90 | public function convertToBusiness($businessName, $websiteUrl = '') |
||
100 | |||
101 | /** |
||
102 | * Login as pinner. |
||
103 | * |
||
104 | * @param string $username |
||
105 | * @param string $password |
||
106 | * |
||
107 | * @throws AuthException |
||
108 | * |
||
109 | * @return bool |
||
110 | */ |
||
111 | public function login($username, $password) |
||
131 | |||
132 | public function logout() |
||
136 | |||
137 | /** |
||
138 | * @return bool |
||
139 | */ |
||
140 | public function isLoggedIn() |
||
144 | |||
145 | /** |
||
146 | * Validates password and login. |
||
147 | * |
||
148 | * @param string $username |
||
149 | * @param string $password |
||
150 | */ |
||
151 | protected function checkCredentials($username, $password) |
||
157 | |||
158 | protected function completeRegistration() |
||
166 | |||
167 | /** |
||
168 | * @param array $data |
||
169 | * @return bool|mixed |
||
170 | * @throws AuthException |
||
171 | */ |
||
172 | protected function makeRegisterCall($data) |
||
183 | } |
||
184 |