/
v.bolshakov
/
AIEcosystem-Testing
Обзор
Документация
Войти
/
v.bolshakov
/
AIEcosystem-Testing
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
dev
common/models/tm/TmTermMongo.php
79 строк
1 KB
Developer
Initial commit
03 авг 2026, 17:43
03 авг 2026, 17:43
7433917
Код
Авторство
О чём код?
<?php namespace common\models\tm; use Yii; use yii\helpers\ArrayHelper; use yii\mongodb\ActiveRecord; /** * Таблица текстовые сегменты в базе данных MongoDB * * @property string $tm_id * @property string $source * @property string $target * * @author Dmitry E. Semenov <sde.tomsk@gmail.com> * @copyright Self (c) 2026 */ class TmTermMongo extends ActiveRecord { /** * @inheritdoc */ public function rules() { return [ [['source', 'target'], 'trim'], [['tm_id', 'source', 'target'], 'required'], [['source', 'target'], 'string'], [['tm_id'], 'number'], ]; } /** * @inheritdoc */ public function attributes() { return [ '_id', 'tm_id', 'source', 'target' ]; } public function getId() { return (string)$this->_id; } public function getTitle() { return '#' . (string)$this->_id; } public function __toString() { return 'source: ' . $this->source; } /** * @inheritdoc */ public function attributeLabels() { return ArrayHelper::merge(parent::attributeLabels(), [ 'tm_id' => Yii::t('app', 'TM'), 'source' => Yii::t('app', 'Source'), 'target' => Yii::t('app', 'Target'), ]); } public static function getAlias() { return ''; } }