src/Entity/Promo.php line 10

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PromoRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassPromoRepository::class)]
  7. class Promo
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column]
  12.     private ?int $id null;
  13.     #[ORM\Column(length255)]
  14.     private ?string $name null;
  15.     #[ORM\Column]
  16.     private ?float $value null;
  17.     #[ORM\Column(length255)]
  18.     private ?string $code null;
  19.     #[ORM\ManyToOne(inversedBy'promos')]
  20.     private ?Corporation $customer null;
  21.     #[ORM\Column(typeTypes::DATE_MUTABLE)]
  22.     private ?\DateTimeInterface $validTill null;
  23.     #[ORM\Column]
  24.     private ?bool $active null;
  25.     #[ORM\Column(nullabletrue)]
  26.     private ?int $uses null;
  27.     public function __construct()
  28.     {
  29.         $this->setValidTill(new \DateTime());
  30.     }
  31.     public function getId(): ?int
  32.     {
  33.         return $this->id;
  34.     }
  35.     public function getName(): ?string
  36.     {
  37.         return $this->name;
  38.     }
  39.     public function setName(string $name): self
  40.     {
  41.         $this->name $name;
  42.         return $this;
  43.     }
  44.     public function getValue(): ?float
  45.     {
  46.         return $this->value;
  47.     }
  48.     public function setValue(float $value): self
  49.     {
  50.         $this->value $value;
  51.         return $this;
  52.     }
  53.     public function getCode(): ?string
  54.     {
  55.         return $this->code;
  56.     }
  57.     public function setCode(string $code): self
  58.     {
  59.         $this->code $code;
  60.         return $this;
  61.     }
  62.     public function getCustomer(): ?Corporation
  63.     {
  64.         return $this->customer;
  65.     }
  66.     public function setCustomer(?Corporation $customer): self
  67.     {
  68.         $this->customer $customer;
  69.         return $this;
  70.     }
  71.     public function getValidTill(): ?\DateTimeInterface
  72.     {
  73.         return $this->validTill;
  74.     }
  75.     public function setValidTill(\DateTimeInterface $validTill): self
  76.     {
  77.         $this->validTill $validTill;
  78.         return $this;
  79.     }
  80.     public function isActive(): ?bool
  81.     {
  82.         return $this->active;
  83.     }
  84.     public function setActive(bool $active): self
  85.     {
  86.         $this->active $active;
  87.         return $this;
  88.     }
  89.     public function getUses(): ?int
  90.     {
  91.         return $this->uses;
  92.     }
  93.     public function setUses(?int $uses): self
  94.     {
  95.         $this->uses $uses;
  96.         return $this;
  97.     }
  98. }