diff --git a/src/PENIntegracao.php b/src/PENIntegracao.php index eff735d8b..1e59f1d55 100755 --- a/src/PENIntegracao.php +++ b/src/PENIntegracao.php @@ -79,6 +79,39 @@ public function montarBotaoControleProcessos() { return array($strAcoesProcedimento); } + public function excluirHipoteseLegal($arrObjHipoteseLegalDTO) { + $this->validarExcluirDesativarHipoteseLegal($arrObjHipoteseLegalDTO); + } + + public function desativarHipoteseLegal($arrObjHipoteseLegalDTO) { + $this->validarExcluirDesativarHipoteseLegal($arrObjHipoteseLegalDTO); + } + + public function validarExcluirDesativarHipoteseLegal($arrObjHipoteseLegalAPI) + { + $excecao = new InfraException(); + foreach ($arrObjHipoteseLegalAPI as $objHipoteseLegalAPI) { + $objPenHipoteseLegalDTO = new PenHipoteseLegalDTO(); + $objPenHipoteseLegalDTO->setNumIdHipoteseLegal($objHipoteseLegalAPI->getNumIdHipoteseLegal()); + $objPenHipoteseLegalDTO->retNumIdHipoteseLegal(); + $objPenHipoteseLegalDTO->retStrNome(); + + $objPenHipoteseLegalRN = new PenHipoteseLegalRN(); + $objPenHipoteseLegalDTO = $objPenHipoteseLegalRN->consultar($objPenHipoteseLegalDTO); + if (!is_null($objPenHipoteseLegalDTO)) { + $excecao->lancarValidacao('Não é permitido excluir ou desativar a hipotese legal "' . $objPenHipoteseLegalDTO->getStrNome() . '"'); + } + } + } + + public function desativarUnidade($arrObjUnidadeAPI) { + $this->validarExcluirDesativarUnidade($arrObjUnidadeAPI); + } + + public function excluirUnidade($arrObjUnidadeAPI) { + $this->validarExcluirDesativarUnidade($arrObjUnidadeAPI); + } + public function montarBotaoProcesso(ProcedimentoAPI $objSeiIntegracaoDTO) { $objProcedimentoDTO = new ProcedimentoDTO();