/
peyli
/
Practice
Обзор
Документация
Войти
/
peyli
/
Practice
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
models/User.php
50 строк
958 B
Катя
Полный код
27 июн 2026, 14:28
27 июн 2026, 14:28
6181a72
Код
Авторство
О чём код?
<?php namespace app\models; use Yii; use yii\db\ActiveRecord; use yii\web\IdentityInterface; class User extends ActiveRecord implements IdentityInterface { public static function tableName() { return 'user'; } public static function findIdentity($id) { return static::findOne($id); } public static function findIdentityByAccessToken($token, $type = null) { return null; } public function getId() { return $this->id; } public function getAuthKey() { return $this->auth_key; } public function validateAuthKey($auth_kay) { return $this->auth_key === $auth_kay; } public static function findByUsername($username) { return static::findOne(['username' => $username]); } public function validatePassword($password) { return Yii::$app->security->validatePassword($password, $this->password); } }