vendor/novosga/core/Entity/Cliente.php line 191

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the Novo SGA project.
  4.  *
  5.  * (c) Rogerio Lino <rogeriolino@gmail.com>
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace Novosga\Entity;
  11. use DateTime;
  12. /**
  13.  * Cliente.
  14.  *
  15.  * @author rogerio
  16.  */
  17. class Cliente implements \JsonSerializable
  18. {
  19.     /**
  20.      * @var mixed
  21.      */
  22.     protected $id;
  23.     
  24.     /**
  25.      * @var string
  26.      */
  27.     private $nome;
  28.     
  29.     /**
  30.      * @var string
  31.      */
  32.     private $documento;
  33.     
  34.     /**
  35.      * @var string
  36.      */
  37.     private $email;
  38.     
  39.     /**
  40.      * @var string
  41.      */
  42.     private $telefone;
  43.     
  44.     /**
  45.      * @var DateTime
  46.      */
  47.     private $dataNascimento;
  48.     
  49.     /**
  50.      * @var string
  51.      */
  52.     private $genero;
  53.     
  54.     /**
  55.      * @var Endereco
  56.      */
  57.     private $endereco;
  58.     
  59.     /**
  60.      * @var string
  61.      */
  62.     private $observacao;
  63.     /**
  64.      * @var string
  65.      */
  66.     private $idarpan;
  67.     public function __construct()
  68.     {
  69.         $this->endereco = new Endereco();
  70.     }
  71.     public function getId()
  72.     {
  73.         return $this->id;
  74.     }
  75.     public function getNome()
  76.     {
  77.         return $this->nome;
  78.     }
  79.     public function getDocumento()
  80.     {
  81.         return $this->documento;
  82.     }
  83.     public function getEmail()
  84.     {
  85.         return $this->email;
  86.     }
  87.     public function getTelefone()
  88.     {
  89.         return $this->telefone;
  90.     }
  91.     public function setId($id): self
  92.     {
  93.         $this->id $id;
  94.         return $this;
  95.     }
  96.     public function setNome($nome): self
  97.     {
  98.         $this->nome $nome;
  99.         return $this;
  100.     }
  101.     public function setDocumento($documento): self
  102.     {
  103.         $this->documento $documento;
  104.         return $this;
  105.     }
  106.     public function setEmail($email): self
  107.     {
  108.         $this->email $email;
  109.         
  110.         return $this;
  111.     }
  112.     public function setTelefone($telefone): self
  113.     {
  114.         $this->telefone $telefone;
  115.         return $this;
  116.     }
  117.     public function getDataNascimento(): ?DateTime
  118.     {
  119.         return $this->dataNascimento;
  120.     }
  121.     public function setDataNascimento(?DateTime $dataNascimento): self
  122.     {
  123.         $this->dataNascimento $dataNascimento;
  124.         return $this;
  125.     }
  126.     public function getGenero(): ?string
  127.     {
  128.         return $this->genero;
  129.     }
  130.     public function setGenero(?string $genero): self
  131.     {
  132.         $this->genero $genero;
  133.         return $this;
  134.     }
  135.     public function getEndereco(): ?Endereco
  136.     {
  137.         return $this->endereco;
  138.     }
  139.     public function setEndereco(Endereco $endereco): self
  140.     {
  141.         $this->endereco $endereco;
  142.         return $this;
  143.     }
  144.     public function getObservacao(): ?string
  145.     {
  146.         return $this->observacao;
  147.     }
  148.     public function setObservacao(?string $observacao): self
  149.     {
  150.         $this->observacao $observacao;
  151.         return $this;
  152.     }
  153.     
  154.     public function __toString()
  155.     {
  156.         return $this->getNome();
  157.     }
  158.     
  159.     public function jsonSerialize()
  160.     {
  161.         return [
  162.             'id'        => $this->getId(),
  163.             'idarpan'   => $this->getIdarpan(),
  164.             'nome'      => $this->getNome(),
  165.             'documento' => $this->getDocumento(),
  166.             'email'     => $this->getEmail(),
  167.             'telefone'  => $this->getTelefone(),
  168.             'genero'  => $this->getGenero(),
  169.             'observacao'  => $this->getObservacao(),
  170.             'dataNascimento'  => $this->getDataNascimento() ? $this->getDataNascimento()->format('Y-m-d') : '',
  171.             'endereco'  => $this->getEndereco(),
  172.         ];
  173.     }
  174.     public function getIdarpan(): ?string
  175.     {
  176.         return $this->idarpan;
  177.     }
  178.     public function setIdarpan(?string $idarpan): self
  179.     {
  180.         $this->idarpan $idarpan;
  181.         return $this;
  182.     }
  183. }