src/Flexy/ShopBundle/Entity/Promotion/PromotionRule.php line 11

  1. <?php
  2. namespace App\Flexy\ShopBundle\Entity\Promotion;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use App\Flexy\ShopBundle\Repository\Promotion\PromotionRuleRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ApiResource]
  7. #[ORM\Entity(repositoryClassPromotionRuleRepository::class)]
  8. class PromotionRule
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\Column(type'datetime_immutable'nullabletrue)]
  15.     private ?\DateTimeImmutable $createdAt null;
  16.     #[ORM\Column(type'string'length255)]
  17.     private ?string $name null;
  18.     #[ORM\Column(type'string'length255nullabletrue)]
  19.     private ?string $type null;
  20.     #[ORM\ManyToOne(targetEntityPromotion::class, inversedBy'promotionRules')]
  21.     #[ORM\JoinColumn(nullablefalse)]
  22.     private ?\App\Flexy\ShopBundle\Entity\Promotion\Promotion $promotion null;
  23.     public function getId(): ?int
  24.     {
  25.         return $this->id;
  26.     }
  27.     public function getCreatedAt(): ?\DateTimeImmutable
  28.     {
  29.         return $this->createdAt;
  30.     }
  31.     public function setCreatedAt(?\DateTimeImmutable $createdAt): self
  32.     {
  33.         $this->createdAt $createdAt;
  34.         return $this;
  35.     }
  36.     public function getName(): ?string
  37.     {
  38.         return $this->name;
  39.     }
  40.     public function setName(string $name): self
  41.     {
  42.         $this->name $name;
  43.         return $this;
  44.     }
  45.     public function getType(): ?string
  46.     {
  47.         return $this->type;
  48.     }
  49.     public function setType(?string $type): self
  50.     {
  51.         $this->type $type;
  52.         return $this;
  53.     }
  54.     public function getPromotion(): ?Promotion
  55.     {
  56.         return $this->promotion;
  57.     }
  58.     public function setPromotion(?Promotion $promotion): self
  59.     {
  60.         $this->promotion $promotion;
  61.         return $this;
  62.     }
  63. }