vendor/novosga/core/Entity/Prioridade.php line 184

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.  * Prioridade
  13.  *
  14.  * @author Rogerio Lino <rogeriolino@gmail.com>
  15.  */
  16. class Prioridade implements \JsonSerializable
  17. {
  18.     /**
  19.      * @var mixed
  20.      */
  21.     protected $id;
  22.     
  23.     /**
  24.      * @var string
  25.      */
  26.     private $nome;
  27.     /**
  28.      * @var string
  29.      */
  30.     private $descricao;
  31.     /**
  32.      * @var int
  33.      */
  34.     private $peso;
  35.     /**
  36.      * @var string
  37.      */
  38.     private $cor;
  39.     /**
  40.      * @var int
  41.      */
  42.     private $ativo;
  43.     /**
  44.      * @var \DateTime
  45.      */
  46.     private $createdAt;
  47.     /**
  48.      * @var \DateTime
  49.      */
  50.     private $updatedAt;
  51.     /**
  52.      * @var \DateTime
  53.      */
  54.     private $deletedAt;
  55.     public function __construct()
  56.     {
  57.         $this->ativo true;
  58.     }
  59.     
  60.     public function getId()
  61.     {
  62.         return $this->id;
  63.     }
  64.     public function setId($id): self
  65.     {
  66.         $this->id $id;
  67.         return $this;
  68.     }
  69.     public function setNome($nome): self
  70.     {
  71.         $this->nome $nome;
  72.         return $this;
  73.     }
  74.     public function getNome()
  75.     {
  76.         return $this->nome;
  77.     }
  78.     public function setDescricao($descricao): self
  79.     {
  80.         $this->descricao $descricao;
  81.         return $this;
  82.     }
  83.     public function getDescricao()
  84.     {
  85.         return $this->descricao;
  86.     }
  87.     public function setPeso($peso): self
  88.     {
  89.         $this->peso $peso;
  90.         return $this;
  91.     }
  92.     public function getPeso()
  93.     {
  94.         return $this->peso;
  95.     }
  96.     public function isAtivo(): bool
  97.     {
  98.         return $this->ativo;
  99.     }
  100.     public function setAtivo(bool $ativo): self
  101.     {
  102.         $this->ativo $ativo;
  103.         return $this;
  104.     }
  105.     
  106.     public function getCreatedAt()
  107.     {
  108.         return $this->createdAt;
  109.     }
  110.     public function getUpdatedAt()
  111.     {
  112.         return $this->updatedAt;
  113.     }
  114.     public function getDeletedAt()
  115.     {
  116.         return $this->deletedAt;
  117.     }
  118.     public function setCreatedAt(\DateTime $createdAt): self
  119.     {
  120.         $this->createdAt $createdAt;
  121.         return $this;
  122.     }
  123.     public function setUpdatedAt(\DateTime $updatedAt): self
  124.     {
  125.         $this->updatedAt $updatedAt;
  126.         return $this;
  127.     }
  128.     public function setDeletedAt(\DateTime $deletedAt): self
  129.     {
  130.         $this->deletedAt $deletedAt;
  131.         return $this;
  132.     }
  133.     public function getCor(): ?string
  134.     {
  135.         return $this->cor;
  136.     }
  137.     public function setCor(?string $cor): self
  138.     {
  139.         $this->cor $cor;
  140.         return $this;
  141.     }
  142.     public function __toString()
  143.     {
  144.         return $this->getNome();
  145.     }
  146.     public function jsonSerialize()
  147.     {
  148.         return [
  149.             'id'        => $this->getId(),
  150.             'nome'      => $this->getNome(),
  151.             'descricao' => $this->getDescricao(),
  152.             'peso'      => $this->getPeso(),
  153.             'cor'       => $this->getCor(),
  154.             'ativo'     => $this->isAtivo(),
  155.             'createdAt' => $this->getCreatedAt() ? $this->getCreatedAt()->format('Y-m-d\TH:i:s') : null,
  156.             'updatedAt' => $this->getUpdatedAt() ? $this->getUpdatedAt()->format('Y-m-d\TH:i:s') : null,
  157.             'deletedAt' => $this->getDeletedAt() ? $this->getDeletedAt()->format('Y-m-d\TH:i:s') : null,
  158.         ];
  159.     }
  160. }