1 | <?php |
||
52 | class User extends ActiveRecord implements IdentityInterface |
||
53 | { |
||
54 | use ModuleAwareTrait; |
||
55 | use ContainerAwareTrait; |
||
56 | |||
57 | // following constants are used on secured email changing process |
||
58 | const OLD_EMAIL_CONFIRMED = 0b1; |
||
59 | const NEW_EMAIL_CONFIRMED = 0b10; |
||
60 | |||
61 | /** |
||
62 | * @var string Plain password. Used for model validation |
||
63 | */ |
||
64 | public $password; |
||
65 | /** |
||
66 | * @var array connected account list |
||
67 | */ |
||
68 | protected $connectedAccounts; |
||
69 | |||
70 | /** |
||
71 | * {@inheritdoc} |
||
72 | */ |
||
73 | public function beforeSave($insert) |
||
93 | |||
94 | /** |
||
95 | * @inheritdoc |
||
96 | */ |
||
97 | public function afterSave($insert, $changedAttributes) |
||
106 | |||
107 | /** |
||
108 | * {@inheritdoc} |
||
109 | */ |
||
110 | 10 | public static function tableName() |
|
114 | |||
115 | /** |
||
116 | * {@inheritdoc} |
||
117 | */ |
||
118 | 1 | public function behaviors() |
|
124 | |||
125 | /** |
||
126 | * {@inheritdoc} |
||
127 | */ |
||
128 | public function attributeLabels() |
||
141 | |||
142 | /** |
||
143 | * {@inheritdoc} |
||
144 | */ |
||
145 | public function scenarios() |
||
158 | |||
159 | /** |
||
160 | * {@inheritdoc} |
||
161 | */ |
||
162 | public function rules() |
||
192 | |||
193 | /** |
||
194 | * {@inheritdoc} |
||
195 | */ |
||
196 | public function validateAuthKey($authKey) |
||
200 | |||
201 | /** |
||
202 | * {@inheritdoc} |
||
203 | */ |
||
204 | public function getId() |
||
208 | |||
209 | /** |
||
210 | * {@inheritdoc} |
||
211 | */ |
||
212 | public function getAuthKey() |
||
216 | |||
217 | /** |
||
218 | * {@inheritdoc} |
||
219 | */ |
||
220 | public static function findIdentity($id) |
||
224 | |||
225 | /** |
||
226 | * @return bool whether is blocked or not |
||
227 | */ |
||
228 | public function getIsBlocked() |
||
232 | |||
233 | /** |
||
234 | * @return bool whether the user is an admin or not |
||
235 | */ |
||
236 | public function getIsAdmin() |
||
240 | |||
241 | /** |
||
242 | * Returns whether user account has been confirmed or not. |
||
243 | * @return bool whether user account has been confirmed or not |
||
244 | */ |
||
245 | public function getIsConfirmed() |
||
249 | |||
250 | /** |
||
251 | * Checks whether a user has a specific role. |
||
252 | * |
||
253 | * @param string $role |
||
254 | * |
||
255 | * @return bool |
||
256 | */ |
||
257 | public function hasRole($role) |
||
261 | |||
262 | /** |
||
263 | * @return \yii\db\ActiveQuery |
||
264 | */ |
||
265 | public function getProfile() |
||
269 | |||
270 | /** |
||
271 | * @return SocialNetworkAccount[] social connected accounts [ 'providerName' => socialAccountModel ] |
||
272 | */ |
||
273 | public function getSocialNetworkAccounts() |
||
291 | |||
292 | /** |
||
293 | * @return UserQuery |
||
294 | */ |
||
295 | 10 | public static function find() |
|
299 | |||
300 | /** |
||
301 | * {@inheritdoc} |
||
302 | */ |
||
303 | public static function findIdentityByAccessToken($token, $type = null) |
||
307 | } |
||
308 |