From 97e3e515da3b00daecfd8be4848963d1158c5095 Mon Sep 17 00:00:00 2001 From: Eduardo Praxedes Date: Thu, 16 Nov 2017 00:01:07 -0200 Subject: [PATCH] Merge no ProcessoEletronicoINT --- int/ProcessoEletronicoINT.php | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/int/ProcessoEletronicoINT.php b/int/ProcessoEletronicoINT.php index 8234d09..8585a86 100644 --- a/int/ProcessoEletronicoINT.php +++ b/int/ProcessoEletronicoINT.php @@ -24,23 +24,26 @@ class ProcessoEletronicoINT extends InfraINT { */ private static function gerarHierarquiaEstruturas($estruturas = array()){ - if(empty($estruturas)) { + if(empty($estruturas)) { return $estruturas; } - foreach($estruturas as &$estrutura) { + foreach($estruturas as &$estrutura) { + if($estrutura->isSetArrHierarquia()) { - $siglas = $estrutura->getArrHierarquia(); - $nome = $estrutura->getStrNome(); - $nome .= ' - '; - $array = array($estrutura->getStrSigla()); - foreach($estrutura->getArrHierarquia() as $sigla) { - if(trim($sigla) !== '' && !in_array($sigla, array('PR', 'UNIAO'))) { - $array[] = $sigla; - } - } - $nome .= implode(' / ', $array); - $estrutura->setStrNome($nome); + $siglas = $estrutura->getArrHierarquia(); + $nome = $estrutura->getStrNome(); + $nome .= ' - '; + + $array = array($estrutura->getStrSigla()); + foreach($estrutura->getArrHierarquia() as $sigla) { + if(trim($sigla) !== '' && !in_array($sigla, array('PR', 'PE', 'UNIAO'))) { + $array[] = $sigla; + } + } + + $nome .= implode(' / ', $array); + $estrutura->setStrNome($nome); } } -- libgit2 0.21.2