You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
403 B
26 lines
403 B
<?php |
|
|
|
namespace tests\models; |
|
|
|
class User extends \yii\db\ActiveRecord |
|
{ |
|
/** |
|
* @inheritdoc |
|
*/ |
|
public static function tableName() |
|
{ |
|
return 'user'; |
|
} |
|
|
|
/** |
|
* @inheritdoc |
|
*/ |
|
public function rules() |
|
{ |
|
return [ |
|
['username', 'required'], |
|
['username', 'unique', 'targetClass' => '\tests\models\User'], |
|
]; |
|
} |
|
|
|
}
|
|
|