<?php
namespace App\Entity;
use App\Repository\PaymentTRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: PaymentTRepository::class)]
class PaymentT
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $paymmentTypeDesc = null;
#[ORM\OneToMany(mappedBy: 'paymentT', targetEntity: User::class)]
private Collection $users;
public function __construct()
{
$this->users = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getPaymmentTypeDesc(): ?string
{
return $this->paymmentTypeDesc;
}
public function setPaymmentTypeDesc(string $paymmentTypeDesc): self
{
$this->paymmentTypeDesc = $paymmentTypeDesc;
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->add($user);
$user->setPaymentT($this);
}
return $this;
}
public function removeUser(User $user): self
{
if ($this->users->removeElement($user)) {
// set the owning side to null (unless already changed)
if ($user->getPaymentT() === $this) {
$user->setPaymentT(null);
}
}
return $this;
}
public function __toString(): string{
return $this->paymmentTypeDesc;
}
}