/
v.bolshakov
/
AIEcosystem-Testing
Обзор
Документация
Войти
/
v.bolshakov
/
AIEcosystem-Testing
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
dev
common/models/VectorStoreFile.php
82 строки
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; /** * Таблица связь векторного хранилища и файлов * * @property int $vector_store_id Векторное хранилище * @property int $file_id Файл * * @author Dmitry E. Semenov <sde.tomsk@gmail.com> * @copyright Self (c) 2025 */ class VectorStoreFile extends \common\models\base\BaseModel { /** * {@inheritdoc} */ public static function tableName() { return 'vector_store_file'; } /** * {@inheritdoc} */ public function rules() { return ArrayHelper::merge(parent::rules(), [ [ [ 'vector_store_id', 'file_id', ], 'required' ], [ [ 'vector_store_id', 'file_id', ], 'number' ], [ ['vector_store_id'], 'unique', 'targetAttribute' => ['vector_store_id', 'file_id'] ] ]); } /** * {@inheritdoc} */ public function attributeLabels() { return ArrayHelper::merge(parent::attributeLabels(), [ 'vector_store_id' => Yii::t('app', 'Vector Store'), 'file_id' => Yii::t('app', 'File'), ]); } /** * @return ActiveQuery */ public function getVectorStore() { return $this->hasOne(VectorStore::class, ['id' => 'vector_store_id']); } /** * @return ActiveQuery */ public function getFile() { return $this->hasOne(File::class, ['id' => 'file_id']); } }