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