accounts/common/models/confirmations/ForgotPassword.php

31 lines
773 B
PHP
Raw Normal View History

<?php
2019-12-14 00:57:13 +05:30
declare(strict_types=1);
namespace common\models\confirmations;
use common\models\EmailActivation;
2019-12-14 00:57:13 +05:30
use common\models\EmailActivationQuery;
use yii\helpers\ArrayHelper;
class ForgotPassword extends EmailActivation {
2019-12-14 00:57:13 +05:30
public static function find(): EmailActivationQuery {
return parent::find()->withType(EmailActivation::TYPE_FORGOT_PASSWORD_KEY);
}
public function behaviors(): array {
return ArrayHelper::merge(parent::behaviors(), [
'expirationBehavior' => [
'repeatTimeout' => 30 * 60,
'expirationTimeout' => 1 * 60 * 60,
],
]);
}
2019-12-14 00:57:13 +05:30
public function init(): void {
parent::init();
$this->type = EmailActivation::TYPE_FORGOT_PASSWORD_KEY;
}
}