1 | <?php |
||
25 | class UserModel extends ActiveRecord implements IdentityInterface |
||
26 | { |
||
27 | |||
28 | /** |
||
29 | * @inheritdoc |
||
30 | */ |
||
31 | public static function tableName() |
||
35 | |||
36 | /** |
||
37 | * @inheritdoc |
||
38 | */ |
||
39 | public function rules() |
||
44 | |||
45 | /** |
||
46 | * @inheritdoc |
||
47 | */ |
||
48 | public static function findIdentity($id) |
||
55 | |||
56 | /** |
||
57 | * @inheritdoc |
||
58 | */ |
||
59 | public static function findIdentityByAccessToken($token, $type = null) |
||
63 | |||
64 | /** |
||
65 | * Finds user by username |
||
66 | * |
||
67 | * @param string $username |
||
68 | * @return static|null |
||
69 | */ |
||
70 | public static function findByUsername($username) |
||
77 | |||
78 | /** |
||
79 | * Finds user by password reset token |
||
80 | * |
||
81 | * @param string $token password reset token |
||
82 | * @return static|null |
||
83 | */ |
||
84 | public static function findByPasswordResetToken($token) |
||
95 | |||
96 | /** |
||
97 | * Finds out if password reset token is valid |
||
98 | * |
||
99 | * @param string $token password reset token |
||
100 | * @return bool |
||
101 | */ |
||
102 | public static function isPasswordResetTokenValid($token) |
||
111 | |||
112 | /** |
||
113 | * @return mixed |
||
114 | */ |
||
115 | public static function find() |
||
121 | |||
122 | /** |
||
123 | * @return mixed |
||
124 | */ |
||
125 | public function getId() |
||
129 | |||
130 | /** |
||
131 | * @return string |
||
132 | */ |
||
133 | public function getAuthKey() |
||
137 | |||
138 | /** |
||
139 | * @param string $authKey |
||
140 | * @return bool |
||
141 | */ |
||
142 | public function validateAuthKey($authKey) |
||
146 | |||
147 | /** |
||
148 | * Validates password |
||
149 | * |
||
150 | * @param string $password password to validate |
||
151 | * @return boolean if password provided is valid for current user |
||
152 | */ |
||
153 | public function validatePassword($password) |
||
159 | |||
160 | /** |
||
161 | * Generates password hash from password and sets it to the model |
||
162 | * |
||
163 | * @param string $password |
||
164 | */ |
||
165 | public function generatePassword($password) |
||
169 | |||
170 | /** |
||
171 | * Generates "remember me" authentication key |
||
172 | */ |
||
173 | public function generateAuthKey() |
||
177 | |||
178 | /** |
||
179 | * Generates new password reset token |
||
180 | */ |
||
181 | public function generatePasswordResetToken() |
||
185 | |||
186 | /** |
||
187 | * Removes password reset token |
||
188 | */ |
||
189 | public function removePasswordResetToken() |
||
193 | |||
194 | public static function attributesMap() |
||
207 | |||
208 | public function behaviors() |
||
222 | |||
223 | } |
||
224 |