919293949596979899100101102103104 * If the model is not found, a 404 HTTP exception will be thrown.
* @param integer $id
* @return Establecimiento the loaded model
* @throws NotFoundHttpException if the model cannot be found
*/
protected function findEstablecimiento($id) {
if (($model = Establecimiento::findOne(['seo_permalink' => $id, 'activo' => Establecimiento::OP_STATUS_ACTIVO_VAL])) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
}
}