mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
20 lines
461 B
PHP
20 lines
461 B
PHP
<?php
|
|
namespace api\modules\accounts\models;
|
|
|
|
use yii\base\ErrorException;
|
|
use const common\LATEST_RULES_VERSION;
|
|
|
|
class AcceptRulesForm extends AccountActionForm {
|
|
|
|
public function performAction(): bool {
|
|
$account = $this->getAccount();
|
|
$account->rules_agreement_version = LATEST_RULES_VERSION;
|
|
if (!$account->save()) {
|
|
throw new ErrorException('Cannot set user rules version');
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
}
|