/**
  * Construtor
  *
  * @return Object:clsCepLogradouroBairro
  */
 function clsCepLogradouroBairro($idlog = false, $cep = false, $idbai = false)
 {
     $objLogradouro = new clsLogradouro($idlog);
     if ($objLogradouro->detalhe()) {
         $this->idlog = $idlog;
     }
     $objCepLogradouro = new clsCepLogradouro($cep, $idlog);
     if ($objCepLogradouro->detalhe()) {
         $this->cep = $cep;
     }
     $objBairro = new clsBairro($idbai);
     if ($objBairro->detalhe()) {
         $this->idbai = $idbai;
     }
     $this->tabela = "cep_logradouro_bairro";
     $this->schema = "urbano";
 }
示例#2
0
 /**
  * Remove o registro atual
  *
  * @return bool
  */
 function exclui()
 {
     if (is_numeric($this->idlog)) {
         $objEndPessoa = new clsEnderecoPessoa();
         $listaEndPessoa = $objEndPessoa->lista(false, false, false, false, false, $this->idlog);
         $objCepLog = new clsCepLogradouro();
         $listaCepLog = $objCepLog->lista(false, $this->idlog);
         $objCepLogBai = new clsCepLogradouroBairro();
         $listaCepLogBai = $objCepLogBai->lista($this->idlog);
         if (!count($listaEndPessoa) && !count($listaCepLog) && !count($listaCepLogBai)) {
             $db = new clsBanco();
             //$db->Consulta("DELETE FROM {$this->schema}.{$this->tabela} WHERE idlog={$this->idlog}");
             return true;
         }
         return false;
     }
     return false;
 }