diff --git a/appexemplo_v2.0/api/api_controllers/Acesso_menuAPI.class.php b/appexemplo_v2.0/api/api_controllers/Acesso_menuAPI.class.php index 2c1bb0de..f49a34cc 100644 --- a/appexemplo_v2.0/api/api_controllers/Acesso_menuAPI.class.php +++ b/appexemplo_v2.0/api/api_controllers/Acesso_menuAPI.class.php @@ -63,13 +63,16 @@ public static function save(Request $request, Response $response, array $args) { $vo = new \Acesso_menuVO; $msg = \Message::GENERIC_INSERT; - if($request->isPut()){ + if($request->getMethod() == 'PUT'){ $msg = \Message::GENERIC_UPDATE; $result = self::selectByIdInside($args); $bodyRequest = $result[0]; $vo = \FormDinHelper::setPropertyVo($bodyRequest,$vo); } $bodyRequest = json_decode($request->getBody(),true); + if(empty($bodyRequest)){ + $bodyRequest = $request->getParsedBody(); + } $vo = \FormDinHelper::setPropertyVo($bodyRequest,$vo); $controller = new \Acesso_menu; diff --git a/appexemplo_v2.0/api/api_controllers/Acesso_perfil_menuAPI.class.php b/appexemplo_v2.0/api/api_controllers/Acesso_perfil_menuAPI.class.php index 3cf7553c..24c60abe 100644 --- a/appexemplo_v2.0/api/api_controllers/Acesso_perfil_menuAPI.class.php +++ b/appexemplo_v2.0/api/api_controllers/Acesso_perfil_menuAPI.class.php @@ -63,13 +63,16 @@ public static function save(Request $request, Response $response, array $args) { $vo = new \Acesso_perfil_menuVO; $msg = \Message::GENERIC_INSERT; - if($request->isPut()){ + if($request->getMethod() == 'PUT'){ $msg = \Message::GENERIC_UPDATE; $result = self::selectByIdInside($args); $bodyRequest = $result[0]; $vo = \FormDinHelper::setPropertyVo($bodyRequest,$vo); } $bodyRequest = json_decode($request->getBody(),true); + if(empty($bodyRequest)){ + $bodyRequest = $request->getParsedBody(); + } $vo = \FormDinHelper::setPropertyVo($bodyRequest,$vo); $controller = new \Acesso_perfil_menu; diff --git a/appexemplo_v2.0/api/api_controllers/Acesso_perfil_userAPI.class.php b/appexemplo_v2.0/api/api_controllers/Acesso_perfil_userAPI.class.php index bde76ffe..9c3b485a 100644 --- a/appexemplo_v2.0/api/api_controllers/Acesso_perfil_userAPI.class.php +++ b/appexemplo_v2.0/api/api_controllers/Acesso_perfil_userAPI.class.php @@ -63,13 +63,16 @@ public static function save(Request $request, Response $response, array $args) { $vo = new \Acesso_perfil_userVO; $msg = \Message::GENERIC_INSERT; - if($request->isPut()){ + if($request->getMethod() == 'PUT'){ $msg = \Message::GENERIC_UPDATE; $result = self::selectByIdInside($args); $bodyRequest = $result[0]; $vo = \FormDinHelper::setPropertyVo($bodyRequest,$vo); } $bodyRequest = json_decode($request->getBody(),true); + if(empty($bodyRequest)){ + $bodyRequest = $request->getParsedBody(); + } $vo = \FormDinHelper::setPropertyVo($bodyRequest,$vo); $controller = new \Acesso_perfil_user; diff --git a/appexemplo_v2.0/api/api_controllers/Acesso_userAPI.class.php b/appexemplo_v2.0/api/api_controllers/Acesso_userAPI.class.php index 14ae408f..556d8cbf 100644 --- a/appexemplo_v2.0/api/api_controllers/Acesso_userAPI.class.php +++ b/appexemplo_v2.0/api/api_controllers/Acesso_userAPI.class.php @@ -63,13 +63,16 @@ public static function save(Request $request, Response $response, array $args) { $vo = new \Acesso_userVO; $msg = \Message::GENERIC_INSERT; - if($request->isPut()){ + if($request->getMethod() == 'PUT'){ $msg = \Message::GENERIC_UPDATE; $result = self::selectByIdInside($args); $bodyRequest = $result[0]; $vo = \FormDinHelper::setPropertyVo($bodyRequest,$vo); } $bodyRequest = json_decode($request->getBody(),true); + if(empty($bodyRequest)){ + $bodyRequest = $request->getParsedBody(); + } $vo = \FormDinHelper::setPropertyVo($bodyRequest,$vo); $controller = new \Acesso_user;