src/Entity/PaymentMode.php line 11
<?phpnamespace App\Entity;use App\Repository\PaymentModeRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: PaymentModeRepository::class)]class PaymentMode{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $code = null;#[ORM\Column(length: 255)]private ?string $libelle = null;/*** NOTE: `mappedBy` must match the property name on Payment (e.g. `$paymentmode`).*/#[ORM\OneToMany(mappedBy: 'paymentmode', targetEntity: Payment::class, cascade: ['persist'], orphanRemoval: false)]private Collection $payments;#[ORM\Column(nullable: true)]private ?bool $status = null;/*** NOTE: `mappedBy` must match the property name on Pay (e.g. `$paymentmode`).*/#[ORM\OneToMany(mappedBy: 'paymentmode', targetEntity: Pay::class, cascade: ['persist'], orphanRemoval: false)]private Collection $pays;public function __construct(){$this->payments = new ArrayCollection();$this->pays = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getCode(): ?string{return $this->code;}public function setCode(?string $code): self{$this->code = $code;return $this;}public function getLibelle(): ?string{return $this->libelle;}public function setLibelle(?string $libelle): self{$this->libelle = $libelle;return $this;}/** @return Collection<int, Payment> */public function getPayments(): Collection{return $this->payments;}public function addPayment(Payment $payment): self{if (!$this->payments->contains($payment)) {$this->payments->add($payment);// Keep owning side in syncif (method_exists($payment, 'setPaymentmode')) {$payment->setPaymentmode($this);}}return $this;}public function removePayment(Payment $payment): self{if ($this->payments->removeElement($payment)) {if (method_exists($payment, 'getPaymentmode') && $payment->getPaymentmode() === $this) {$payment->setPaymentmode(null);}}return $this;}public function getStatus(): ?bool{return $this->status;}// Symfony will also look for "isStatus" on booleans; keep both for compatibility.public function isStatus(): ?bool{return $this->status;}public function setStatus(?bool $status): self{$this->status = $status;return $this;}/** @return Collection<int, Pay> */public function getPays(): Collection{return $this->pays;}public function addPay(Pay $pay): self{if (!$this->pays->contains($pay)) {$this->pays->add($pay);if (method_exists($pay, 'setPaymentmode')) {$pay->setPaymentmode($this);}}return $this;}public function removePay(Pay $pay): self{if ($this->pays->removeElement($pay)) {if (method_exists($pay, 'getPaymentmode') && $pay->getPaymentmode() === $this) {$pay->setPaymentmode(null);}}return $this;}public function __toString(): string{// Avoid returning null to prevent "must be of type string, null returned"return $this->libelle?? $this->code?? sprintf('Mode #%s', $this->id ?? 'N/A');}}