| Total Complexity | 7 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class ArticleCategoryController extends ActiveController |
||
| 8 | { |
||
| 9 | public $modelClass = ArticleCategory::class; |
||
| 10 | |||
| 11 | public function getQuery($action) |
||
| 12 | { |
||
| 13 | return parent::getQuery($action) |
||
| 14 | ->alias('c') |
||
| 15 | ->orderBy([ |
||
| 16 | 'c.name' => SORT_ASC |
||
| 17 | ]); |
||
| 18 | } |
||
| 19 | |||
| 20 | public function searchModel() |
||
| 21 | { |
||
| 22 | return (new DynamicModel(['id' => '', 'name' => ''])) |
||
| 23 | ->addRule(['name'], 'string') |
||
| 24 | ->addRule(['id'], 'number'); |
||
| 25 | } |
||
| 26 | |||
| 27 | protected function applyFilter($query, $model, $filter) |
||
| 37 | } |
||
| 38 | } |
||
| 39 | } |
||
| 41 |