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