/
v.bolshakov
/
AIEcosystem-Testing
Обзор
Документация
Войти
/
v.bolshakov
/
AIEcosystem-Testing
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
dev
common/models/RequestBatch.php
81 строка
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; /** * Таблица - запросы поделённые на batch * * @property integer $request_id * @property integer $batch_index * @property integer $token_count * * @author Dmitry E. Semenov <sde.tomsk@gmail.com> * @copyright Self (c) 2024 */ class RequestBatch extends \common\models\base\BaseModel { /** * {@inheritdoc} */ public static function tableName() { return 'request_batch'; } /** * {@inheritdoc} */ public function rules() { return ArrayHelper::merge(parent::rules(), [ ['token_count', 'default', 'value' => 0], [ [ 'request_id', 'batch_index', 'token_count', ], 'required' ], [ [ 'request_id', 'batch_index', 'token_count', ], 'number' ], [ ['request_id'], 'exist', 'skipOnError' => true, 'targetClass' => Request::class, 'targetAttribute' => ['request_id' => 'id'] ], ]); } /** * {@inheritdoc} */ public function attributeLabels() { return ArrayHelper::merge(parent::attributeLabels(), [ 'request_id' => Yii::t('app', 'Request'), 'batch_index' => Yii::t('app', 'Batch index'), 'token_count' => Yii::t('app', 'Token count'), ]); } /** * @return ActiveQuery */ public function getRequest() { return $this->hasOne(Request::class, ['id' => 'request_id']); } }