/
v.bolshakov
/
AIEcosystem-Testing
Обзор
Документация
Войти
/
v.bolshakov
/
AIEcosystem-Testing
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
dev
common/search/base/ByLabelSearch.php
64 строки
1 KB
Developer
Initial commit
03 авг 2026, 17:43
03 авг 2026, 17:43
7433917
Код
Авторство
О чём код?
<?php namespace common\search\base; use Yii; use yii\helpers\ArrayHelper; /** * Форма для фильтров поиска по названию * * @author Dmitry E. Semenov <sde.tomsk@gmail.com> * @copyright Self (c) 2022 */ class ByLabelSearch extends BaseSearch { /** * Строка поиска * @var string */ public $search = null; /** * @inheritdoc */ public function rules() { return [ [['search'], 'string'], ]; } /** * @inheritdoc */ public function getPublicFields() { return [ 'search', ]; } /** * @inheritdoc */ public function attributeLabels() { return ArrayHelper::merge(parent::attributeLabels(), [ 'search' => Yii::t('app', 'Type text'), ]); } /** * @inheritdoc */ protected function doSearch() { $fields = [ 'label' ]; $this->query ->filterData($fields, $this->search, false, true, false, true); } }