Добавлено поле версии принятых правил

This commit is contained in:
ErickSkrauch
2016-08-06 18:52:03 +03:00
parent 9330041b4c
commit cf6c7bc88e
10 changed files with 90 additions and 3 deletions

View File

@@ -16,6 +16,7 @@ use Ramsey\Uuid\Uuid;
use Yii;
use yii\base\ErrorException;
use yii\base\InvalidConfigException;
use const common\LATEST_RULES_VERSION;
class RegistrationForm extends ApiForm {
@@ -92,6 +93,7 @@ class RegistrationForm extends ApiForm {
$account->password = $this->password;
$account->lang = $this->lang;
$account->status = Account::STATUS_REGISTERED;
$account->rules_agreement_version = LATEST_RULES_VERSION;
if (!$account->save()) {
throw new ErrorException('Account not created.');
}