/
v.bolshakov
/
AIEcosystem-Testing
Обзор
Документация
Войти
/
v.bolshakov
/
AIEcosystem-Testing
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
dev
common/models/tm/LinkUserTm.php
75 строк
1 KB
Developer
Initial commit
03 авг 2026, 17:43
03 авг 2026, 17:43
7433917
Код
Авторство
О чём код?
<?php namespace common\models\tm; use common\models\base\BaseModel; use common\models\User; use Yii; use yii\db\ActiveQuery; use yii\helpers\ArrayHelper; /** * This is the model class for table "l_user_tm". * * @property int $tm_id * @property int $user_id * * @author Dmitry E. Semenov <sde.tomsk@gmail.com> * @copyright Self (c) 2025 */ class LinkUserTm extends BaseModel { /** * {@inheritdoc} */ public static function tableName() { return 'l_user_tm'; } /** * {@inheritdoc} */ public function rules() { return ArrayHelper::merge(parent::rules(), [ [['tm_id', 'user_id'], 'number'], [['tm_id', 'user_id'], 'required'], [ [ 'tm_id', 'user_id' ], 'unique', 'targetAttribute' => ['tm_id', 'user_id'] ], ]); } /** * {@inheritdoc} */ public function attributeLabels() { return ArrayHelper::merge(parent::attributeLabels(), [ 'user_id' => Yii::t('app', 'User'), 'tm_id' => Yii::t('app', 'Department'), ]); } /** * @return ActiveQuery */ public function getUser() { return $this->hasOne(User::class, ['id' => 'user_id']); } /** * @return ActiveQuery */ public function getTm() { return $this->hasOne(Tm::class, ['id' => 'tm_id']); } }