vendor/novosga/core/Entity/Local.php line 94

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. /**
  12.  * Local de atendimento
  13.  *
  14.  * @author Rogerio Lino <rogeriolino@gmail.com>
  15.  */
  16. class Local implements \JsonSerializable
  17. {
  18.     /**
  19.      * @var mixed
  20.      */
  21.     protected $id;
  22.     
  23.     /**
  24.      * @var string
  25.      */
  26.     private $nome;
  27.     /**
  28.      * @var \DateTime
  29.      */
  30.     private $createdAt;
  31.     /**
  32.      * @var \DateTime
  33.      */
  34.     private $updatedAt;
  35.     public function getId()
  36.     {
  37.         return $this->id;
  38.     }
  39.     public function setId($id): self
  40.     {
  41.         $this->id $id;
  42.         return $this;
  43.     }
  44.     
  45.     public function setNome($nome): self
  46.     {
  47.         $this->nome $nome;
  48.         return $this;
  49.     }
  50.     public function getNome()
  51.     {
  52.         return $this->nome;
  53.     }
  54.     
  55.     public function getCreatedAt()
  56.     {
  57.         return $this->createdAt;
  58.     }
  59.     public function getUpdatedAt()
  60.     {
  61.         return $this->updatedAt;
  62.     }
  63.     public function setCreatedAt(\DateTime $createdAt): self
  64.     {
  65.         $this->createdAt $createdAt;
  66.         return $this;
  67.     }
  68.     public function setUpdatedAt(\DateTime $updatedAt): self
  69.     {
  70.         $this->updatedAt $updatedAt;
  71.         return $this;
  72.     }
  73.     
  74.     public function __toString()
  75.     {
  76.         return $this->getNome();
  77.     }
  78.     public function jsonSerialize()
  79.     {
  80.         return [
  81.             'id'        => $this->getId(),
  82.             'nome'      => $this->getNome(),
  83.             'createdAt' => $this->getCreatedAt() ? $this->getCreatedAt()->format('Y-m-d\TH:i:s') : null,
  84.             'updatedAt' => $this->getUpdatedAt() ? $this->getUpdatedAt()->format('Y-m-d\TH:i:s') : null,
  85.         ];
  86.     }
  87. }