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