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

parent 32cebfc0
...@@ -514,12 +514,15 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter ...@@ -514,12 +514,15 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter
return parent::beforeSave($insert); return parent::beforeSave($insert);
} }
public function afterValidate() { public function validate($attributeNames = null, $clearErrors = true) {
parent::afterValidate(); if (!parent::validate($attributeNames = null, $clearErrors = true))
return false;
if ($this->scenario===self::SCENARIO_REGISTRATION) { if ($this->scenario===self::SCENARIO_REGISTRATION) {
$this->afterRegistration(['email' => $this->email]); if (!$this->afterRegistration(['email' => $this->email]))
return false;
} }
return true;
} }
public function beforeDelete() 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