<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Entity;
/**
* Prioridade
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
class Prioridade implements \JsonSerializable
{
/**
* @var mixed
*/
protected $id;
/**
* @var string
*/
private $nome;
/**
* @var string
*/
private $descricao;
/**
* @var int
*/
private $peso;
/**
* @var string
*/
private $cor;
/**
* @var int
*/
private $ativo;
/**
* @var \DateTime
*/
private $createdAt;
/**
* @var \DateTime
*/
private $updatedAt;
/**
* @var \DateTime
*/
private $deletedAt;
public function __construct()
{
$this->ativo = true;
}
public function getId()
{
return $this->id;
}
public function setId($id): self
{
$this->id = $id;
return $this;
}
public function setNome($nome): self
{
$this->nome = $nome;
return $this;
}
public function getNome()
{
return $this->nome;
}
public function setDescricao($descricao): self
{
$this->descricao = $descricao;
return $this;
}
public function getDescricao()
{
return $this->descricao;
}
public function setPeso($peso): self
{
$this->peso = $peso;
return $this;
}
public function getPeso()
{
return $this->peso;
}
public function isAtivo(): bool
{
return $this->ativo;
}
public function setAtivo(bool $ativo): self
{
$this->ativo = $ativo;
return $this;
}
public function getCreatedAt()
{
return $this->createdAt;
}
public function getUpdatedAt()
{
return $this->updatedAt;
}
public function getDeletedAt()
{
return $this->deletedAt;
}
public function setCreatedAt(\DateTime $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function setUpdatedAt(\DateTime $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function setDeletedAt(\DateTime $deletedAt): self
{
$this->deletedAt = $deletedAt;
return $this;
}
public function getCor(): ?string
{
return $this->cor;
}
public function setCor(?string $cor): self
{
$this->cor = $cor;
return $this;
}
public function __toString()
{
return $this->getNome();
}
public function jsonSerialize()
{
return [
'id' => $this->getId(),
'nome' => $this->getNome(),
'descricao' => $this->getDescricao(),
'peso' => $this->getPeso(),
'cor' => $this->getCor(),
'ativo' => $this->isAtivo(),
'createdAt' => $this->getCreatedAt() ? $this->getCreatedAt()->format('Y-m-d\TH:i:s') : null,
'updatedAt' => $this->getUpdatedAt() ? $this->getUpdatedAt()->format('Y-m-d\TH:i:s') : null,
'deletedAt' => $this->getDeletedAt() ? $this->getDeletedAt()->format('Y-m-d\TH:i:s') : null,
];
}
}