add changes to account state
This commit is contained in:
@@ -8,6 +8,7 @@ use common\models\User;
|
||||
class UserUpdate extends User {
|
||||
public $password_plain;
|
||||
public $password_repeat;
|
||||
public $selected_accounts = [];
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
@@ -21,9 +22,16 @@ class UserUpdate extends User {
|
||||
['email' ,'unique' , 'targetClass' => User::className(), 'targetAttribute' => 'email'],
|
||||
['username' ,'unique', 'targetClass' => User::className(), 'targetAttribute' => 'username'],
|
||||
[['password_plain' ,'password_repeat'] ,'string','min' =>6 ],
|
||||
[['password_repeat'] ,'validatePasswordRepeat' ]
|
||||
[['password_repeat'] ,'validatePasswordRepeat' ],
|
||||
['selected_accounts',function ($attribute, $params) {
|
||||
if (!is_array($this->$attribute)) {
|
||||
$this->addError($attribute, 'Invalid array');
|
||||
}
|
||||
}
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @formatter:on
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user