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