<?php// src/Entity/PaymentMethod.phpnamespace App\Entity;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Gedmo\Blameable\Traits\BlameableEntity;use Gedmo\Timestampable\Traits\TimestampableEntity;use Symfony\Component\Validator\Constraints as Assert;#[ORM\Entity]#[ORM\Table(name: 'payment_method')]class PaymentMethod{ use BlameableEntity; //Hook blameable behaviour. Updates createdBy, updatedBy fields use TimestampableEntity; //Hook timestampable behaviour. Updates createdAt, updatedAt fields #[ORM\Id] #[ORM\GeneratedValue(strategy: "IDENTITY")] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 255, nullable: true)] #[Assert\Length(max: 255)] private ?string $name = null; #[ORM\Column(length: 255, nullable: true)] #[Assert\Length(max: 255)] private ?string $holderId = null; #[ORM\Column(nullable: true)] private ?bool $active = null; #[ORM\OneToMany(mappedBy: 'paymentMethod', targetEntity: User::class)] private Collection $users; public function __construct() { $this->users = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getName(): ?string { return $this->name; } public function setName(?string $name): self { $this->name = $name; return $this; } public function getHolderId(): ?string { return $this->holderId; } public function setHolderId(?string $holderId): self { $this->holderId = $holderId; return $this; } public function isActive(): ?bool { return $this->active; } public function setActive(?bool $active): self { $this->active = $active; return $this; } /** * @return Collection<int, User> */ public function getUsers(): Collection { return $this->users; } public function addUser(User $user): self { if (!$this->users->contains($user)) { $this->users[] = $user; $user->setPaymentMethod($this); } return $this; } public function removeUser(User $user): self { if ($this->users->removeElement($user)) { if ($user->getPaymentMethod() === $this) { $user->setPaymentMethod(null); } } return $this; }}