accounts/common/models/confirmations/NewEmailConfirmation.php

37 lines
904 B
PHP
Raw Normal View History

<?php
2019-12-13 22:27:13 +03:00
declare(strict_types=1);
namespace common\models\confirmations;
use common\models\EmailActivation;
2019-12-13 22:27:13 +03:00
use common\models\EmailActivationQuery;
use yii\helpers\ArrayHelper;
/**
* Behaviors:
* @mixin NewEmailConfirmationBehavior
*/
class NewEmailConfirmation extends EmailActivation {
2019-12-13 22:27:13 +03:00
public static function find(): EmailActivationQuery {
return parent::find()->withType(EmailActivation::TYPE_NEW_EMAIL_CONFIRMATION);
}
public function behaviors(): array {
return ArrayHelper::merge(parent::behaviors(), [
'expirationBehavior' => [
2018-04-17 23:47:25 +03:00
'repeatTimeout' => 5 * 60,
],
'dataBehavior' => [
'class' => NewEmailConfirmationBehavior::class,
],
]);
}
2019-12-13 22:27:13 +03:00
public function init(): void {
parent::init();
$this->type = EmailActivation::TYPE_NEW_EMAIL_CONFIRMATION;
}
}