vendor/novosga/core/Entity/Departamento.php line 133

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.  * Departamento
  13.  *
  14.  * @author Rogerio Lino <rogeriolino@gmail.com>
  15.  */
  16. class Departamento implements \JsonSerializable
  17. {
  18.     /**
  19.      * @var mixed
  20.      */
  21.     protected $id;
  22.     /**
  23.      * @var string
  24.      */
  25.     private $nome;
  26.     /**
  27.      * @var string
  28.      */
  29.     private $descricao;
  30.     /**
  31.      * @var int
  32.      */
  33.     private $ativo;
  34.     /**
  35.      * @var \DateTime
  36.      */
  37.     private $createdAt;
  38.     /**
  39.      * @var \DateTime
  40.      */
  41.     private $updatedAt;
  42.     public function __construct()
  43.     {
  44.         $this->ativo true;
  45.     }
  46.     public function getId()
  47.     {
  48.         return $this->id;
  49.     }
  50.     public function setId($id): self
  51.     {
  52.         $this->id $id;
  53.         return $this;
  54.     }
  55.     public function setNome($nome): self
  56.     {
  57.         $this->nome $nome;
  58.         return $this;
  59.     }
  60.     public function getNome()
  61.     {
  62.         return $this->nome;
  63.     }
  64.     public function setDescricao($descricao): self
  65.     {
  66.         $this->descricao $descricao;
  67.         return $this;
  68.     }
  69.     public function getDescricao()
  70.     {
  71.         return $this->descricao;
  72.     }
  73.     public function isAtivo(): bool
  74.     {
  75.         return $this->ativo;
  76.     }
  77.     public function setAtivo(bool $ativo): self
  78.     {
  79.         $this->ativo $ativo;
  80.         return $this;
  81.     }
  82.     public function getCreatedAt()
  83.     {
  84.         return $this->createdAt;
  85.     }
  86.     public function getUpdatedAt()
  87.     {
  88.         return $this->updatedAt;
  89.     }
  90.     public function setCreatedAt(\DateTime $createdAt): self
  91.     {
  92.         $this->createdAt $createdAt;
  93.         return $this;
  94.     }
  95.     public function setUpdatedAt(\DateTime $updatedAt): self
  96.     {
  97.         $this->updatedAt $updatedAt;
  98.         
  99.         return $this;
  100.     }
  101.     public function __toString()
  102.     {
  103.         return $this->getNome();
  104.     }
  105.     public function jsonSerialize()
  106.     {
  107.         return [
  108.             'id'        => $this->getId(),
  109.             'nome'      => $this->getNome(),
  110.             'descricao' => $this->getDescricao(),
  111.             'ativo'     => $this->isAtivo(),
  112.         ];
  113.     }
  114. }