<?phpnamespace App\Entity;use App\Repository\PaymentMethodRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: PaymentMethodRepository::class)]class PaymentMethod{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 255)] private ?string $name = null; #[ORM\Column(length: 255, nullable: true)] private ?string $description = null; #[ORM\OneToMany(mappedBy: 'paymentMethod', targetEntity: Livraisons::class)] private Collection $livraisons; #[ORM\OneToMany(mappedBy: 'paymentMethod', targetEntity: User::class)] private Collection $users; #[ORM\OneToMany(mappedBy: 'paymentMethod', targetEntity: Souscription::class)] private Collection $souscriptions; public function __construct() { $this->livraisons = new ArrayCollection(); $this->users = new ArrayCollection(); $this->souscriptions = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getName(): ?string { return $this->name; } public function setName(string $name): static { $this->name = $name; return $this; } public function getDescription(): ?string { return $this->description; } public function setDescription(?string $description): static { $this->description = $description; return $this; } /** * @return Collection<int, Livraisons> */ public function getLivraisons(): Collection { return $this->livraisons; } public function addLivraison(Livraisons $livraison): static { if (!$this->livraisons->contains($livraison)) { $this->livraisons->add($livraison); $livraison->setPaymentMethod($this); } return $this; } public function removeLivraison(Livraisons $livraison): static { if ($this->livraisons->removeElement($livraison)) { // set the owning side to null (unless already changed) if ($livraison->getPaymentMethod() === $this) { $livraison->setPaymentMethod(null); } } return $this; } /** * @return Collection<int, User> */ public function getUsers(): Collection { return $this->users; } public function addUser(User $user): static { if (!$this->users->contains($user)) { $this->users->add($user); $user->setPaymentMethod($this); } return $this; } public function removeUser(User $user): static { if ($this->users->removeElement($user)) { // set the owning side to null (unless already changed) if ($user->getPaymentMethod() === $this) { $user->setPaymentMethod(null); } } return $this; } /** * @return Collection<int, Souscription> */ public function getSouscriptions(): Collection { return $this->souscriptions; } public function addSouscription(Souscription $souscription): static { if (!$this->souscriptions->contains($souscription)) { $this->souscriptions->add($souscription); $souscription->setPaymentMethod($this); } return $this; } public function removeSouscription(Souscription $souscription): static { if ($this->souscriptions->removeElement($souscription)) { // set the owning side to null (unless already changed) if ($souscription->getPaymentMethod() === $this) { $souscription->setPaymentMethod(null); } } return $this; }}