/
v.bolshakov
/
AIEcosystem-Testing
Обзор
Документация
Войти
/
v.bolshakov
/
AIEcosystem-Testing
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
dev
common/kdf/SLanguageDirection.php
110 строк
3 KB
Developer
Initial commit
03 авг 2026, 17:43
03 авг 2026, 17:43
7433917
Код
Авторство
О чём код?
<?php namespace common\kdf; use common\models\base\BaseModel; use Yii; use yii\db\ActiveQuery; use yii\helpers\ArrayHelper; /** * This is the model class for table "s_language_direction". * * @property int $language_id Language * @property int $direction_id direction * @property int $driver_id system * * @author Dmitry E. Semenov <sde.tomsk@gmail.com> * @copyright Self (c) 2023 */ class SLanguageDirection extends BaseModel { /** * {@inheritdoc} */ public static function tableName() { return 's_language_direction'; } /** * {@inheritdoc} */ public function rules() { return ArrayHelper::merge(parent::rules(), [ [['driver_id', 'language_id', 'direction_id'], 'required'], [['language_id', 'driver_id', 'direction_id'], 'integer'], [ [ 'language_id', ], 'unique', 'targetAttribute' => ['language_id', 'driver_id', 'direction_id'] ], [ ['language_id'], 'exist', 'skipOnError' => true, 'targetClass' => KLanguage::class, 'targetAttribute' => ['language_id' => 'id'] ], [ ['driver_id'], 'exist', 'skipOnError' => true, 'targetClass' => KSystem::class, 'targetAttribute' => ['driver_id' => 'id'] ], [ ['direction_id'], 'exist', 'skipOnError' => true, 'targetClass' => KDirection::class, 'targetAttribute' => ['direction_id' => 'id'] ], ]); } /** * {@inheritdoc} */ public function attributeLabels() { return ArrayHelper::merge(parent::attributeLabels(), [ 'language_id' => Yii::t('app', 'Language'), 'direction_id' => Yii::t('app', 'Direction'), 'driver_id' => Yii::t('app', 'System'), ]); } /** * Gets query for [[Language]]. * * @return ActiveQuery */ public function getLanguage() { return $this->hasOne(KLanguage::class, ['id' => 'language_id']); } /** * Gets query for [[System]]. * * @return ActiveQuery */ public function getSystem() { return $this->hasOne(KSystem::class, ['id' => 'driver_id']); } /** * Gets query for [[Direction]]. * * @return ActiveQuery */ public function getDirection() { return $this->hasOne(KDirection::class, ['id' => 'direction_id']); } }