<?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;
/**
* Departamento
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
class Departamento implements \JsonSerializable
{
/**
* @var mixed
*/
protected $id;
/**
* @var string
*/
private $nome;
/**
* @var string
*/
private $descricao;
/**
* @var int
*/
private $ativo;
/**
* @var \DateTime
*/
private $createdAt;
/**
* @var \DateTime
*/
private $updatedAt;
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 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 setCreatedAt(\DateTime $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function setUpdatedAt(\DateTime $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function __toString()
{
return $this->getNome();
}
public function jsonSerialize()
{
return [
'id' => $this->getId(),
'nome' => $this->getNome(),
'descricao' => $this->getDescricao(),
'ativo' => $this->isAtivo(),
];
}
}