Exemple #1
0
 private function bindingClientes(\PDOStatement $statement, ClienteAbstract $cliente)
 {
     $statement->bindValue(":nome", $cliente->getNome());
     $statement->bindValue(":telefone", $cliente->getTelefone());
     $statement->bindValue(":endereco", $cliente->getEndereco());
     if ($cliente instanceof PessoaFisicaType) {
         $statement->bindValue(":documento", $cliente->getCpf());
         $statement->bindValue(":tipo_cliente", "PF");
     } else {
         $statement->bindValue(":documento", $cliente->getCnpj());
         $statement->bindValue(":tipo_cliente", "PJ");
     }
 }
 public function insert(ClienteAbstract $cliente)
 {
     $stmt = $this->conn->prepare('INSERT INTO clientes VALUES(:id, :nome, :cpf, :endereco, :enderecoCobranca, :tipo, :grau)');
     $stmt->execute(array(':id' => null, ':nome' => $cliente->getNome(), ':cpf' => $cliente->getCpf(), ':endereco' => $cliente->getEndereco(), ':enderecoCobranca' => $cliente->getEnderecoCobranca(), ':tipo' => $cliente->getTipo(), ':grau' => $cliente->getGrauImportancia()));
 }
 public function __construct($id, $nome, $cpf, $endereco)
 {
     parent::__construct($id, $nome, $cpf, $endereco);
     $this->tipo = 1;
 }
Exemple #4
0
 public function __construct($nome, $telefone, $endereco, $cpf, $id = null)
 {
     parent::__construct($nome, $telefone, $endereco, $id);
     $this->cpf = $cpf;
 }