私は Yii フレームワークを初めて使用するので、その仕組みを理解しようとしています。ユーザーがフォームを作成するための次の検証ルールがあります。すべての検証ルールがユーザーパスワードのハッシュを通過した場合、必要なのは afterValidation() メソッドをチェックインすることです。私が知らないのは、Yii にバリデーション ルールがパスしたかどうかで true または false を返す組み込みメソッドがあるかどうかです。
 public function rules()
    {
        // NOTE: you should only define rules for those attributes that
        // will receive user inputs.
        return array(
            array('email, password, username', 'required'),
            array('email, username, password', 'length', 'max'=>256),
            array('email, username', 'unique'),
            array('password', 'compare'),
            array('password_repeat', 'safe'),
        );
    }
 protected function afterValidate()
        {
            parent::afterValidate();
          if("VALIDATION RULES HAVE PASSED, ther is no error message")
{  
            $this->password = $this->encrypt($this->password);
}
        }
        public function encrypt($value)
        {
          return md5($value);
        }