portal.mkgtu.ru/common/modules/abiturient/models/ActualAddressData.php

67 lines
1.5 KiB
PHP
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace common\modules\abiturient\models;
use common\modules\abiturient\models\bachelor\changeHistory\ChangeHistoryClasses;
use common\modules\abiturient\validators\extenders\ActualAddressData\ActualAddressAppsCheckValidation;
use Yii;
use yii\helpers\ArrayHelper;
class ActualAddressData extends AddressData
{
public $sameAsRegistrationAddress;
public $validation_extender;
public function __construct($config = [])
{
parent::__construct($config);
$this->validation_extender = new ActualAddressAppsCheckValidation([
'model' => $this
]);
}
public function formName()
{
return 'ActualAddressData';
}
public static function find()
{
return parent::find()->where([
'address_type' => self::ADDRESS_TYPE_ACTUAL
]);
}
public function rules()
{
return ArrayHelper::merge(parent::rules(), $this->validation_extender ? $this->validation_extender->getRules() : []);
}
public function getClassTypeForChangeHistory(): int
{
return ChangeHistoryClasses::CLASS_ACTUAL_ADDRESS_DATA;
}
public function getAddressTypeComputed(): int
{
return self::ADDRESS_TYPE_ACTUAL;
}
public function getValidatedName(): string
{
return Yii::t(
'abiturient/questionary/address-data',
'Валидационное имя модели: `Данные о адресе проживания`'
);
}
}