Exemplo n.º 1
0
 public function listar($ordem = "ASC", $campo = self::ID)
 {
     $info = parent::listar($ordem, $campo);
     if (!empty($info)) {
         if ($info[self::TIPO] == self::VALOR_TIPO_PESSOA_FISICA) {
             $temp = new PessoaFisica($info[self::ID]);
         } elseif ($info[self::TIPO] == self::VALOR_TIPO_PESSOA_JURIDICA) {
             $temp = new PessoaJuridica($info[self::ID]);
         }
         $temp->razaoSocial = $info[self::RAZAOSOCIAL];
         $temp->cnpj = $info[self::CNPJ];
         $temp->rg = $info[self::RG];
         $temp->cpf = $info[self::CPF];
         $temp->setDataNasc(new DataHora($info[self::DATANASC]));
         $temp->usuario = $info[self::USUARIO];
         $temp->nome = $info[self::NOME];
         $temp->sobreNome = $info[self::SOBRENOME];
         $temp->emailPrimario = $info[self::EMAIL];
         $temp->senha = $info[self::SENHA];
         $temp->emailSecundario = $info[self::EMAILSECUNDARIO];
         $temp->sexo = $info[self::SEXO];
         $temp->site = $info[self::SITE];
         $temp->atacadista = $info[self::ATACADISTA] == self::VALOR_ATACADISTA_TRUE ? true : false;
         $temp->origemCadastro = $info[self::ORIGEMCADASTRO];
         $temp->setDataCadastro(new DataHora($info[self::DATACADASTRO]));
         if (!empty($info[self::FOTO])) {
             $temp->setFoto(new Image(new Arquivos(Sistema::$caminhoURL . Sistema::$caminhoDataPessoasPerfil . $info[self::FOTO])));
         }
         return $temp;
     }
 }