Рефакторинг. В АПИ добавлены методы в изменения: username, email, password
This commit is contained in:
1 parent
b02d0b3ddf
commit
672d0833c5
10 files changed
+385
-77
No files matched your search
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace frontend\modules\api\models\profile;
|
||||
use yii\base\Model;
|
||||
|
||||
class ProfileChangeEmailForm extends Model
|
||||
{
|
||||
|
||||
public $newEmail;
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['newEmail'], 'string'],
|
||||
[['newEmail'], 'required'],
|
||||
[['newEmail'], 'email'],
|
||||
['newEmail', 'unique', 'targetAttribute' => 'email', 'targetClass' => User::class],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function formName(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user