src/Entity/Sequence.php line 21

  1. <?php
  2. /*
  3.  *  @author Guerby Duval <info@tranzaksyon.com>
  4.  *  @link https://tranzaksyon.com
  5.  *  @copyright You are not allowed to remove this author "Guerby Duval <info@tranzaksyon.com>", the link "https://tranzaksyon.com" neither this copyright.
  6.  */
  7. namespace App\Entity;
  8. use App\Repository\SequenceRepository;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  11. use Symfony\Component\Validator\Constraints\GreaterThanOrEqual;
  12. use Symfony\Component\Validator\Constraints\NotBlank;
  13. use Symfony\Component\Validator\Constraints\NotNull;
  14. #[ORM\Entity(repositoryClassSequenceRepository::class)]
  15. #[UniqueEntity(['serie1''serie2''sriInfo''number''invoiceType''sucursal'])]
  16. #[ORM\Table]
  17. #[ORM\UniqueConstraint(columns: ['serie1''serie2''sri_info_id''number''invoice_type''sucursal_id'])]
  18. class Sequence
  19. {
  20.     #[ORM\Id]
  21.     #[ORM\GeneratedValue]
  22.     #[ORM\Column]
  23.     private ?int $id null;
  24.     #[ORM\Column(length3)]
  25.     private ?string $serie1 null;
  26.     #[ORM\Column(length3)]
  27.     private ?string $serie2 null;
  28.     #[ORM\Column]
  29.     #[NotNull]
  30.     #[GreaterThanOrEqual(0)]
  31.     private ?int $number null;
  32.     #[ORM\ManyToOne(inversedBy'sequences')]
  33.     #[ORM\JoinColumn(nullablefalse)]
  34.     private ?SriInfo $sriInfo null;
  35.     #[ORM\Column(length255nullablefalsecolumnDefinition"ENUM('factura', 'notaCredito', 'retencion','liquidacion', 'guiaRemision', 'debitNote',  'autoFactura')")]
  36.     #[NotBlank]
  37.     private ?string $invoiceType null;
  38.     #[ORM\ManyToOne(inversedBy'sequences')]
  39.     private ?Sucursal $sucursal null;
  40.     public function getId(): ?int
  41.     {
  42.         return $this->id;
  43.     }
  44.     public function getNumber(): ?int
  45.     {
  46.         return $this->number;
  47.     }
  48.     public function setNumber(?int $number): self
  49.     {
  50.         $this->number $number;
  51.         return $this;
  52.     }
  53.     public function getSriInfo(): ?SriInfo
  54.     {
  55.         return $this->sriInfo;
  56.     }
  57.     public function setSriInfo(?SriInfo $sriInfo): self
  58.     {
  59.         $this->sriInfo $sriInfo;
  60.         return $this;
  61.     }
  62.     public function getInvoiceType(): ?string
  63.     {
  64.         return $this->invoiceType;
  65.     }
  66.     public function setInvoiceType(string $invoiceType): self
  67.     {
  68.         $this->invoiceType $invoiceType;
  69.         return $this;
  70.     }
  71.     public function getSerie1(): ?string
  72.     {
  73.         return $this->serie1;
  74.     }
  75.     public function setSerie1(string $serie1): self
  76.     {
  77.         $this->serie1 $serie1;
  78.         return $this;
  79.     }
  80.     public function getSerie2(): ?string
  81.     {
  82.         return $this->serie2;
  83.     }
  84.     public function setSerie2(string $serie2): self
  85.     {
  86.         $this->serie2 $serie2;
  87.         return $this;
  88.     }
  89.     public function getSucursal(): ?Sucursal
  90.     {
  91.         return $this->sucursal;
  92.     }
  93.     public function setSucursal(?Sucursal $sucursal): self
  94.     {
  95.         $this->sucursal $sucursal;
  96.         return $this;
  97.     }
  98. }