TimestampBehavior::class, 'updatedAtAttribute' => false, ], 'expirationBehavior' => [ 'class' => EmailActivationExpirationBehavior::class, 'repeatTimeout' => 5 * 60, 'expirationTimeout' => -1, ], ]; } public function getAccount() { return $this->hasOne(Account::class, ['id' => 'account_id']); } /** * @inheritdoc */ public static function instantiate($row) { $type = ArrayHelper::getValue($row, 'type'); if ($type === null) { return new static; } $classMap = self::getClassMap(); if (!isset($classMap[$type])) { throw new InvalidConfigException('Unexpected type'); } return new $classMap[$type]; } public static function getClassMap() { return [ self::TYPE_REGISTRATION_EMAIL_CONFIRMATION => confirmations\RegistrationConfirmation::class, self::TYPE_FORGOT_PASSWORD_KEY => confirmations\RecoverPassword::class, ]; } }