src/Entity/Almacen/Deposito.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Almacen;
  3. use App\Repository\Almacen\DepositoRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  7. /**
  8.  * @ORM\Entity(repositoryClass=DepositoRepository::class)
  9.  * @ORM\Table(name="gral_depositos")
  10.  * @UniqueEntity(
  11.  *     fields={"nombre"},
  12.  *     errorPath="nombre",
  13.  *     message="Ya existe un deposito con el nombre ingresado"
  14.  * )
  15.  */
  16. class Deposito
  17. {
  18.     /**
  19.      * @ORM\Id
  20.      * @ORM\GeneratedValue
  21.      * @ORM\Column(type="integer")
  22.      */
  23.     private $id;
  24.     /**
  25.      * @ORM\Column(type="string", length=255)
  26.      * @Assert\NotNull(message="El campo es requerido")
  27.      */
  28.     private $nombre;
  29.     /**
  30.      * @ORM\Column(type="string", length=255, nullable=true)
  31.      */
  32.     private $ubicacion;
  33.     /**
  34.      * @ORM\Column(type="boolean", options={"default": true})
  35.      */
  36.     private $activo true;
  37.     /**
  38.      * @ORM\Column(type="boolean", options={"default": false})
  39.      */
  40.     private $depositoDefecto false;
  41.     public function __toString()
  42.     {
  43.         return $this->nombre;
  44.     }
  45.     public function getId(): ?int
  46.     {
  47.         return $this->id;
  48.     }
  49.     public function getNombre(): ?string
  50.     {
  51.         return $this->nombre;
  52.     }
  53.     public function setNombre(string $nombre): self
  54.     {
  55.         $this->nombre $nombre;
  56.         return $this;
  57.     }
  58.     public function getUbicacion(): ?string
  59.     {
  60.         return $this->ubicacion;
  61.     }
  62.     public function setUbicacion(?string $ubicacion): self
  63.     {
  64.         $this->ubicacion $ubicacion;
  65.         return $this;
  66.     }
  67.     public function isActivo(): ?bool
  68.     {
  69.         return $this->activo;
  70.     }
  71.     public function setActivo(bool $activo): self
  72.     {
  73.         $this->activo $activo;
  74.         return $this;
  75.     }
  76.     public function isDepositoDefecto(): ?bool
  77.     {
  78.         return $this->depositoDefecto;
  79.     }
  80.     public function setDepositoDefecto(bool $depositoDefecto): self
  81.     {
  82.         $this->depositoDefecto $depositoDefecto;
  83.         return $this;
  84.     }
  85. }