src/Entity/Movimientos/Proveedor.php line 22

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Movimientos;
  3. use App\Repository\Movimientos\ProveedorRepository;
  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=ProveedorRepository::class)
  9.  * @ORM\Table(name="mov_proveedores")
  10.  * @UniqueEntity(
  11.  *     fields={"razonSocial"},
  12.  *     errorPath="razonSocial",
  13.  *     message="Ya existe un proveedor con la razon social ingresada"
  14.  * )
  15.  */
  16. class Proveedor
  17. {
  18.     /**
  19.      * @ORM\Id
  20.      * @ORM\GeneratedValue
  21.      * @ORM\Column(type="integer")
  22.      */
  23.     private $id;
  24.     /**
  25.      * @ORM\Column(name="razon_social", type="string", length=255)
  26.      * @Assert\NotNull(message="El campo es requerido")
  27.      */
  28.     private $razonSocial;
  29.     /**
  30.      * @ORM\Column(type="string", length=255, nullable=true)
  31.      */
  32.     private $cuit;
  33.     /**
  34.      * @ORM\Column(type="boolean")
  35.      */
  36.     private $activo true;
  37.     public function __toString()
  38.     {
  39.         return $this->razonSocial;
  40.     }
  41.     public function getId(): ?int
  42.     {
  43.         return $this->id;
  44.     }
  45.     public function getRazonSocial(): ?string
  46.     {
  47.         return $this->razonSocial;
  48.     }
  49.     public function setRazonSocial(string $razonSocial): self
  50.     {
  51.         $this->razonSocial $razonSocial;
  52.         return $this;
  53.     }
  54.     public function getCuit(): ?string
  55.     {
  56.         return $this->cuit;
  57.     }
  58.     public function setCuit(?string $cuit): self
  59.     {
  60.         $this->cuit $cuit;
  61.         return $this;
  62.     }
  63.     public function isActivo(): ?bool
  64.     {
  65.         return $this->activo;
  66.     }
  67.     public function setActivo(bool $activo): self
  68.     {
  69.         $this->activo $activo;
  70.         return $this;
  71.     }
  72. }