<?phpnamespace App\Entity;use App\Repository\PlanRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: PlanRepository::class)]class Plan{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 255, nullable: true)] private ?string $nom = null; #[ORM\Column(length: 255, nullable: true)] private ?string $slug = null; #[ORM\Column(length: 255, nullable: true)] private ?string $stripeId = null; #[ORM\Column(nullable: true)] private ?int $prix = null; #[ORM\Column(type: Types::TEXT, nullable: true)] private ?string $description = null; #[ORM\Column(type: Types::DATETIME_MUTABLE)] private ?\DateTimeInterface $createdAt = null; #[ORM\OneToMany(mappedBy: 'plan', targetEntity: Subscription::class)] private Collection $subscriptions; #[ORM\Column(length: 255, nullable: true)] private ?string $paymentLink = null; public function __construct() { $this->subscriptions = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getNom(): ?string { return $this->nom; } public function setNom(?string $nom): self { $this->nom = $nom; return $this; } public function getSlug(): ?string { return $this->slug; } public function setSlug(?string $slug): self { $this->slug = $slug; return $this; } public function getStripeId(): ?string { return $this->stripeId; } public function setStripeId(?string $stripeId): self { $this->stripeId = $stripeId; return $this; } public function getPrix(): ?int { return $this->prix; } public function setPrix(?int $prix): self { $this->prix = $prix; return $this; } public function getDescription(): ?string { return $this->description; } public function setDescription(?string $description): self { $this->description = $description; return $this; } public function getCreatedAt(): ?\DateTimeInterface { return $this->createdAt; } public function setCreatedAt(?\DateTimeInterface $createdAt): self { $this->createdAt = $createdAt; return $this; } /** * @return Collection<int, Subscription> */ public function getSubscriptions(): Collection { return $this->subscriptions; } public function addSubscription(Subscription $subscription): self { if (!$this->subscriptions->contains($subscription)) { $this->subscriptions->add($subscription); $subscription->setPlan($this); } return $this; } public function removeSubscription(Subscription $subscription): self { if ($this->subscriptions->removeElement($subscription)) { // set the owning side to null (unless already changed) if ($subscription->getPlan() === $this) { $subscription->setPlan(null); } } return $this; } public function getPaymentLink(): ?string { return $this->paymentLink; } public function setPaymentLink(?string $paymentLink): self { $this->paymentLink = $paymentLink; return $this; }}