src/Entity/Plan.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PlanRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassPlanRepository::class)]
  9. class Plan
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255nullabletrue)]
  16.     private ?string $nom null;
  17.     #[ORM\Column(length255nullabletrue)]
  18.     private ?string $slug null;
  19.     #[ORM\Column(length255nullabletrue)]
  20.     private ?string $stripeId null;
  21.     #[ORM\Column(nullabletrue)]
  22.     private ?int $prix null;
  23.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  24.     private ?string $description null;
  25.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  26.     private ?\DateTimeInterface $createdAt null;
  27.     #[ORM\OneToMany(mappedBy'plan'targetEntitySubscription::class)]
  28.     private Collection $subscriptions;
  29.     #[ORM\Column(length255nullabletrue)]
  30.     private ?string $paymentLink null;
  31.     public function __construct()
  32.     {
  33.         $this->subscriptions = new ArrayCollection();
  34.     }
  35.     public function getId(): ?int
  36.     {
  37.         return $this->id;
  38.     }
  39.     public function getNom(): ?string
  40.     {
  41.         return $this->nom;
  42.     }
  43.     public function setNom(?string $nom): self
  44.     {
  45.         $this->nom $nom;
  46.         return $this;
  47.     }
  48.     public function getSlug(): ?string
  49.     {
  50.         return $this->slug;
  51.     }
  52.     public function setSlug(?string $slug): self
  53.     {
  54.         $this->slug $slug;
  55.         return $this;
  56.     }
  57.     public function getStripeId(): ?string
  58.     {
  59.         return $this->stripeId;
  60.     }
  61.     public function setStripeId(?string $stripeId): self
  62.     {
  63.         $this->stripeId $stripeId;
  64.         return $this;
  65.     }
  66.     public function getPrix(): ?int
  67.     {
  68.         return $this->prix;
  69.     }
  70.     public function setPrix(?int $prix): self
  71.     {
  72.         $this->prix $prix;
  73.         return $this;
  74.     }
  75.     public function getDescription(): ?string
  76.     {
  77.         return $this->description;
  78.     }
  79.     public function setDescription(?string $description): self
  80.     {
  81.         $this->description $description;
  82.         return $this;
  83.     }
  84.     public function getCreatedAt(): ?\DateTimeInterface
  85.     {
  86.         return $this->createdAt;
  87.     }
  88.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  89.     {
  90.         $this->createdAt $createdAt;
  91.         return $this;
  92.     }
  93.     /**
  94.      * @return Collection<int, Subscription>
  95.      */
  96.     public function getSubscriptions(): Collection
  97.     {
  98.         return $this->subscriptions;
  99.     }
  100.     public function addSubscription(Subscription $subscription): self
  101.     {
  102.         if (!$this->subscriptions->contains($subscription)) {
  103.             $this->subscriptions->add($subscription);
  104.             $subscription->setPlan($this);
  105.         }
  106.         return $this;
  107.     }
  108.     public function removeSubscription(Subscription $subscription): self
  109.     {
  110.         if ($this->subscriptions->removeElement($subscription)) {
  111.             // set the owning side to null (unless already changed)
  112.             if ($subscription->getPlan() === $this) {
  113.                 $subscription->setPlan(null);
  114.             }
  115.         }
  116.         return $this;
  117.     }
  118.     public function getPaymentLink(): ?string
  119.     {
  120.         return $this->paymentLink;
  121.     }
  122.     public function setPaymentLink(?string $paymentLink): self
  123.     {
  124.         $this->paymentLink $paymentLink;
  125.         return $this;
  126.     }
  127. }