예제 #1
0
 /**
  * @param  array  $data
  * @param  int    $selected
  * @param  array  $config
  * @return string
  */
 public function nuArtefato(Artefato $entArtefato, $sqTipoArtefato = null)
 {
     $return = NULL;
     $coAmbitoProcesso = Processo::T_TIPO_AMBITO_PROCESSO_FEDERAL;
     if (is_null($sqTipoArtefato)) {
         $sqTipoArtefato = $entArtefato->getSqTipoArtefatoAssunto()->getSqTipoArtefato()->getSqTipoArtefato();
     }
     // PROCESSO
     if ($sqTipoArtefato == \Core_Configuration::getSgdoceTipoArtefatoProcesso()) {
         $nuArtefato = $entArtefato->getNuArtefato();
         if (method_exists($entArtefato, 'getSqArtefatoProcesso') && $entArtefato->getSqArtefatoProcesso()) {
             $coAmbitoProcesso = $entArtefato->getSqArtefatoProcesso()->getCoAmbitoProcesso();
         }
         // SE AMBITO FEDERAL APLICA MÁSCARA
         if ($coAmbitoProcesso == Processo::T_TIPO_AMBITO_PROCESSO_FEDERAL) {
             $nuArtefato = $this->mask($nuArtefato);
         }
         return $nuArtefato;
     } else {
         return $entArtefato->getNuDigital()->getNuEtiqueta(TRUE);
     }
     return $return;
 }
예제 #2
0
 public function formataProcessoAmbitoFederal(\Sgdoce\Model\Entity\Artefato $entityArtefato)
 {
     $maskNumberFilter = new \Core_Filter_MaskNumber();
     $nuProcesso = $entityArtefato->getNuArtefato();
     if (self::T_TIPO_AMBITO_PROCESSO_FEDERAL == $entityArtefato->getSqArtefatoProcesso()->getCoAmbitoProcesso()) {
         $mask = null;
         switch (strlen($nuProcesso)) {
             case 21:
                 $mask = self::T_MASK_21_DIGITS;
                 break;
             case 17:
                 $mask = self::T_MASK_17_DIGITS;
                 break;
             case 15:
                 $mask = self::T_MASK_15_DIGITS;
                 break;
         }
         if (!is_null($mask)) {
             $maskNumberFilter->setMask($mask);
             $nuProcesso = $maskNumberFilter->filter($nuProcesso);
         }
     }
     return $nuProcesso;
 }