/
v.bolshakov
/
AIEcosystem-Testing
Обзор
Документация
Войти
/
v.bolshakov
/
AIEcosystem-Testing
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
dev
common/models/ResponseBatch.php
86 строк
2 KB
Developer
Initial commit
03 авг 2026, 17:43
03 авг 2026, 17:43
7433917
Код
Авторство
О чём код?
<?php namespace common\models; use common\behaviors\UserRecordBehavior; use common\helpers\UuidHelper; use common\kdf\KLanguage; use common\validators\UidValidator; use Yii; use yii\db\ActiveQuery; use yii\db\Expression; use yii\helpers\ArrayHelper; use yii\helpers\VarDumper; /** * Таблица - ответы * * @property integer $request_batch_id * @property integer $time_spent * @property integer $attempt * * @author Dmitry E. Semenov <sde.tomsk@gmail.com> * @copyright Self (c) 2024 */ class ResponseBatch extends \common\models\base\BaseModel { /** * {@inheritdoc} */ public static function tableName() { return 'response_batch'; } /** * {@inheritdoc} */ public function rules() { return ArrayHelper::merge(parent::rules(), [ [ [ 'request_batch_id', 'time_spent', 'attempt', ], 'required' ], [ [ 'request_batch_id', 'time_spent', 'attempt' ], 'number' ], [ ['request_batch_id'], 'exist', 'skipOnError' => true, 'targetClass' => RequestBatch::class, 'targetAttribute' => ['request_batch_id' => 'id'] ], ]); } /** * {@inheritdoc} */ public function attributeLabels() { return ArrayHelper::merge(parent::attributeLabels(), [ 'request_batch_id' => Yii::t('app', 'Request batch'), 'time_spent' => Yii::t('app', 'Time spent'), 'attempt' => Yii::t('app', 'Attempt'), ]); } /** * @return ActiveQuery */ public function getRequestBatch() { return $this->hasOne(RequestBatch::class, ['id' => 'request_batch_id']); } }