src/Entity/PaymentType.php line 14
<?phpnamespace App\Entity;use App\Entity\Interfaces\HasCode;use App\Repository\PaymentTypeRepository;use App\Utility\Traits\Entity\HasCodeTrait;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: PaymentTypeRepository::class)]class PaymentType implements HasCode{use HasCodeTrait;public const TYPE_DONATION = 'DN';public const TYPE_MEMBERSHIP = 'MB';public const TYPE_PARTY_PILLAR ='PP';public const TYPE_RENEW_MEMBERSHIP = 'RM';#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column(length: 2)]private ?string $paymentTypeCode = null;#[ORM\Column(length: 255)]private ?string $name = null;#[ORM\Column]private ?int $amount = null;#[ORM\Column(type: Types::DATETIME_MUTABLE)]private ?\DateTimeInterface $updated = null;#[ORM\OneToMany(mappedBy: 'paymentType', targetEntity: Payment::class)]private Collection $payments;public function __construct(){$this->payments = new ArrayCollection();}public function getPaymentTypeCode(): ?string{return $this->paymentTypeCode;}public function setPaymentTypeCode(string $paymentTypeCode): static{$this->paymentTypeCode = $paymentTypeCode;return $this;}public function getName(): ?string{return $this->name;}public function setName(string $name): static{$this->name = $name;return $this;}public function getAmount(): ?int{return $this->amount;}public function setAmount(int $amount): static{$this->amount = $amount;return $this;}public function getUpdated(): ?\DateTimeInterface{return $this->updated;}#[ORM\PrePersist]#[ORM\PreUpdate]public function setUpdatedTimestamp(): void{$this->updated = new \DateTime();}/*** @return Collection<int, Payment>*/public function getPayments(): Collection{return $this->payments;}public function addPayment(Payment $payment): static{if (!$this->payments->contains($payment)) {$this->payments->add($payment);$payment->setPaymentType($this);}return $this;}public function removePayment(Payment $payment): static{if ($this->payments->removeElement($payment)) {// set the owning side to null (unless already changed)if ($payment->getPaymentType() === $this) {$payment->setPaymentType(null);}}return $this;}}