/
v.bolshakov
/
AIEcosystem-Testing
Обзор
Документация
Войти
/
v.bolshakov
/
AIEcosystem-Testing
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
dev
common/models/ClonedTask.php
78 строк
2 KB
Developer
Initial commit
03 авг 2026, 17:43
03 авг 2026, 17:43
7433917
Код
Авторство
О чём код?
<?php namespace common\models; use Yii; use yii\db\ActiveQuery; use yii\helpers\ArrayHelper; /** * Таблица - связь клонируемых task * * @property string $cloned_task_id Заголовок * @property int $task_id * * @author Dmitry E. Semenov <sde.tomsk@gmail.com> * @copyright Self (c) 2024 */ class ClonedTask extends \common\models\base\BaseModel { /** * @inheritdoc */ public $softDelete = true; /** * {@inheritdoc} */ public static function tableName() { return 'cloned_task'; } /** * {@inheritdoc} */ public function rules() { return ArrayHelper::merge(parent::rules(), [ [['cloned_task_id', 'task_id'], 'required'], [['cloned_task_id', 'task_id'], 'number'], [ [ 'cloned_task_id', 'task_id' ], 'unique', 'targetAttribute' => ['cloned_task_id', 'task_id'] ], ]); } /** * {@inheritdoc} */ public function attributeLabels() { return ArrayHelper::merge(parent::attributeLabels(), [ 'cloned_task_id' => Yii::t('app', 'Cloned task'), 'task_id' => Yii::t('app', 'Task'), ]); } /** * @return ActiveQuery */ public function getCLonedTask() { return $this->hasOne(Task::class, ['id' => 'task_id']); } /** * @return ActiveQuery */ public function getTask() { return $this->hasOne(Task::class, ['id' => 'task_id']); } }