/** * Finds the Styles model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $style_id * @param integer $item_id * @return Styles the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($style_id, $item_id) { if (($model = Styles::findOne(['style_id' => $style_id, 'item_id' => $item_id])) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }