<?php
namespace App\Entity\Mantenimiento;
use App\Repository\Mantenimiento\SectorPlantaRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* @ORM\Entity(repositoryClass=SectorPlantaRepository::class)
* @ORM\Table(name="mant_sector_planta")
* @UniqueEntity(
* fields={"nombre"},
* errorPath="nombre",
* message="Ya existe un sector con el nombre ingresado"
* )
*/
class SectorPlanta
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
* @Assert\NotNull(message="El campo es requerido")
*/
private $nombre;
/**
* @ORM\Column(type="boolean")
*/
private $active = true;
public function __toString()
{
return strtoupper($this->nombre);
}
public function getId(): ?int
{
return $this->id;
}
public function getNombre(): ?string
{
return $this->nombre;
}
public function setNombre(string $nombre): self
{
$this->nombre = $nombre;
return $this;
}
public function isActive(): ?bool
{
return $this->active;
}
public function setActive(bool $active): self
{
$this->active = $active;
return $this;
}
}