- Переписан метод валидации

parent 32cebfc0
......@@ -514,12 +514,15 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter
return parent::beforeSave($insert);
}
public function afterValidate() {
parent::afterValidate();
public function validate($attributeNames = null, $clearErrors = true) {
if (!parent::validate($attributeNames = null, $clearErrors = true))
return false;
if ($this->scenario===self::SCENARIO_REGISTRATION) {
$this->afterRegistration(['email' => $this->email]);
if (!$this->afterRegistration(['email' => $this->email]))
return false;
}
return true;
}
public function beforeDelete()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment