| Conditions | 6 |
| Paths | 24 |
| Total Lines | 17 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 5 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 32 | public function run() |
||
| 33 | { |
||
| 34 | /** |
||
| 35 | * @var ActiveRecord $searchModel |
||
| 36 | */ |
||
| 37 | $this->searchModel = $this->modelSearchClass ? new $this->modelSearchClass : null; |
||
| 38 | $query = is_callable($this->query) ? call_user_func($this->query, $this->modelClass, $this) : $this->query; |
||
| 39 | |||
| 40 | if (is_callable($this->condition)) { |
||
| 41 | call_user_func($this->condition, $query, $this); |
||
| 42 | } elseif ($this->condition) { |
||
| 43 | $query->andWhere($this->condition); |
||
| 44 | } |
||
| 45 | |||
| 46 | $dataProvider = is_callable($this->dataProvider) ? call_user_func($this->dataProvider, $query, $this) : $this->dataProvider; |
||
| 47 | |||
| 48 | return $this->render($this->view, ['searchModel' => $this->searchModel, 'dataProvider' => $dataProvider]); |
||
| 49 | } |
||
| 50 | } |