nordsoftware\yii_account\exceptions\Exception

Failed to save token.

/Users/Crisu/Dev/Web/GitHub/NordSoftware/yii-account/src/Module.php(204)

192         $token = $tokenGenerator->generate();
193 
194         $modelClass = $this->getClassName(Module::CLASS_TOKEN_MODEL);
195 
196         /** @var \nordsoftware\yii_account\models\ar\AccountToken $model */
197         $model = new $modelClass();
198         $model->type = $type;
199         $model->accountId = $accountId;
200         $model->token = $token;
201         $model->expiresAt = $expires;
202 
203         if (!$model->save()) {
204             throw new Exception('Failed to save token.');
205         }
206 
207         return $token;
208     }
209 
210     /**
211      * Loads a token of a specific type.
212      *
213      * @param string $type token type.
214      * @param string $token token string.
215      * @throws \nordsoftware\yii_account\exceptions\Exception
216      * @return \nordsoftware\yii_account\models\ar\AccountToken

Stack Trace

#0
+
 /Users/Crisu/Dev/Web/GitHub/NordSoftware/yii-account/src/controllers/Controller.php(71): nordsoftware\yii_account\Module->generateToken("resetPassword", null, "2014-06-06 11:10:23")
66      * @param string $expires token expiration date (mysql date).
67      * @return string the generated token.
68      */
69     public function generateToken($type, $accountId, $expires)
70     {
71         return $this->module->generateToken($type, $accountId, $expires);
72     }
73 
74     /**
75      * Loads a token of a specific type.
76      *
#1
+
 /Users/Crisu/Dev/Web/GitHub/NordSoftware/yii-account/src/controllers/PasswordController.php(83): nordsoftware\yii_account\controllers\Controller->generateToken("resetPassword", null, "2014-06-06 11:10:23")
78 
79                 $token = $this->generateToken(
80                     Module::TOKEN_RESET_PASSWORD,
81                     $account->id,
82                     Helper::sqlDateTime(time() + $this->module->resetPasswordExpireTime)
83                 );
84 
85                 $resetUrl = $this->createAbsoluteUrl('/account/password/reset', array('token' => $token));
86 
87                 $this->module->sendMail(
88                     $account->email,
#10
+
 /Users/Crisu/Dev/Web/GitHub/NordSoftware/yii-account/tests/app/www/index.php(16): CApplication->run()
11 require("$vendor/autoload.php");
12 require("$vendor/yiisoft/yii/framework/yii.php");
13 
14 $config = require("$tests/app/config/web.php");
15 
16 Yii::createWebApplication($config)->run();
2014-06-05 11:10:23 Apache/2.2.26 (Unix) mod_fastcgi/2.4.6 mod_wsgi/3.4 Python/2.7.6 PHP/5.5.10 mod_ssl/2.2.26 OpenSSL/0.9.8y DAV/2 mod_perl/2.0.8 Perl/v5.18.2 Yii Framework/1.1.15-dev