| Conditions | 4 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | public function findModel(ActiveRecord $model, $id, string $checkAccess = null): ActiveRecord |
||
| 24 | { |
||
| 25 | $model = $model::findOne($id); |
||
| 26 | |||
| 27 | if ($model === null || ($checkAccess !== null && !$model->$checkAccess())) { |
||
| 28 | throw new NotFoundHttpException(Yii::t('app', 'Page not found')); |
||
| 29 | } // @codeCoverageIgnore |
||
| 30 | |||
| 31 | return $model; |
||
| 32 | } |
||
| 33 | |||
| 56 |