1 | <?php |
||
33 | class Admin extends ActiveRecord implements IdentityInterface |
||
34 | { |
||
35 | const STATUS_INACTIVE = 0; |
||
36 | const STATUS_ACTIVE = 10; |
||
37 | |||
38 | public $imageFile; |
||
39 | |||
40 | public $isAdmin = true; |
||
41 | |||
42 | /** |
||
43 | * @var string|null the current password value from form input |
||
44 | */ |
||
45 | protected $_password; |
||
46 | |||
47 | /** |
||
48 | * @inheritdoc |
||
49 | */ |
||
50 | 16 | public static function tableName() |
|
54 | |||
55 | /** |
||
56 | * @return AdminQuery custom query class with user scopes |
||
57 | */ |
||
58 | 14 | public static function find() |
|
62 | |||
63 | /** |
||
64 | * @inheritdoc |
||
65 | */ |
||
66 | 7 | public function scenarios() |
|
72 | |||
73 | /** |
||
74 | * @inheritdoc |
||
75 | */ |
||
76 | 7 | public function rules() |
|
106 | |||
107 | /** |
||
108 | * @inheritdoc |
||
109 | */ |
||
110 | 2 | public function attributeLabels() |
|
126 | |||
127 | /** |
||
128 | * @inheritdoc |
||
129 | */ |
||
130 | 17 | public function behaviors() |
|
138 | |||
139 | /** |
||
140 | * @inheritdoc |
||
141 | */ |
||
142 | 6 | public function beforeSave($insert) |
|
156 | |||
157 | /** |
||
158 | * @inheritdoc |
||
159 | */ |
||
160 | 5 | public static function findIdentity($id) |
|
164 | |||
165 | /** |
||
166 | * @inheritdoc |
||
167 | */ |
||
168 | 1 | public static function findIdentityByAccessToken($token, $type = null) |
|
172 | |||
173 | /** |
||
174 | * @inheritdoc |
||
175 | */ |
||
176 | 3 | public function getId() |
|
180 | |||
181 | /** |
||
182 | * @inheritdoc |
||
183 | */ |
||
184 | 1 | public function getAuthKey() |
|
188 | |||
189 | /** |
||
190 | * @inheritdoc |
||
191 | */ |
||
192 | 1 | public function validateAuthKey($authKey) |
|
196 | |||
197 | /** |
||
198 | * Validates password |
||
199 | * |
||
200 | * @param string $password password to validate |
||
201 | * @return boolean if password provided is valid for current user |
||
202 | */ |
||
203 | 4 | public function validatePassword($password) |
|
207 | |||
208 | /** |
||
209 | * Generates password hash from password and sets it to the model |
||
210 | * |
||
211 | * @param string $password |
||
212 | */ |
||
213 | 3 | public function setPassword($password) |
|
220 | |||
221 | /** |
||
222 | * @return string|null the current password value, if set from form. Null otherwise. |
||
223 | */ |
||
224 | public function getPassword() |
||
228 | |||
229 | /** |
||
230 | * Generates "remember me" authentication key |
||
231 | */ |
||
232 | 1 | public function generateAuthKey() |
|
236 | |||
237 | /** |
||
238 | * Generates new email confirmation token |
||
239 | * @param bool $save whether to save the record. Default is `false`. |
||
240 | * @return bool|null whether the save was successful or null if $save was false. |
||
241 | */ |
||
242 | public function generateEmailConfirmationToken($save = false) |
||
249 | |||
250 | /** |
||
251 | * Generates new password reset token |
||
252 | * @param bool $save whether to save the record. Default is `false`. |
||
253 | * @return bool|null whether the save was successful or null if $save was false. |
||
254 | */ |
||
255 | 3 | public function generatePasswordResetToken($save = false) |
|
262 | |||
263 | /** |
||
264 | * Resets to a new password and deletes the password reset token. |
||
265 | * @param string $password the new password for this user. |
||
266 | * @return bool whether the record was updated successfully |
||
267 | */ |
||
268 | 3 | public function resetPassword($password) |
|
274 | |||
275 | public static function getStatusList() |
||
282 | |||
283 | /** |
||
284 | * 上传头像 |
||
285 | * @return bool |
||
286 | */ |
||
287 | 1 | public function upload() |
|
303 | |||
304 | /** |
||
305 | * 获取头像地址 |
||
306 | * @return string |
||
307 | */ |
||
308 | 1 | public function getImageUrl() |
|
315 | } |
||
316 |
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.