| Conditions | 4 |
| Paths | 3 |
| Total Lines | 22 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | 1 | public function search( |
|
| 31 | array $params, |
||
| 32 | ?string $formName = '' |
||
| 33 | ): ?ActiveDataProvider { |
||
| 34 | 1 | $this->load($params, $formName); |
|
| 35 | 1 | if (!$this->validate()) { |
|
| 36 | 1 | return null; |
|
| 37 | } |
||
| 38 | if ( |
||
| 39 | 1 | null === $this->sourceStage |
|
| 40 | 1 | || $this->sourceStage->workflow_id != $params['workflow_id'] |
|
| 41 | ) { |
||
| 42 | 1 | throw new NotFoundHttpException('Unexistant stage path.'); |
|
| 43 | } |
||
| 44 | |||
| 45 | 1 | $class = get_parent_class(); |
|
| 46 | 1 | return new ActiveDataProvider([ |
|
| 47 | 1 | 'query' => $class::find()->andFilterWhere([ |
|
| 48 | 1 | 'source_stage_id' => $this->source_stage_id, |
|
| 49 | 1 | 'created_by' => $this->created_by, |
|
|
|
|||
| 50 | ]) |
||
| 51 | 1 | ->andFilterWhere(['like', 'name', $this->name]), |
|
| 52 | ]); |
||
| 55 |