<?phpnamespace App\Entity;use App\Repository\DebtRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: DebtRepository::class)]class Debt{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: 'integer')] private $id; #[ORM\Column(type: 'float')] private $amount = 0; #[ORM\Column(type: 'float')] private $amountPayed = 0; #[ORM\ManyToOne(targetEntity: Person::class, inversedBy: 'debts')] #[ORM\JoinColumn(nullable: false)] private $person; #[ORM\ManyToOne(targetEntity: Section::class)] #[ORM\JoinColumn(nullable: false)] private $section; #[ORM\ManyToOne(targetEntity: Season::class)] private $season; #[ORM\Column(type: 'string', length: 255)] private $comment; #[ORM\OneToMany(mappedBy: 'debt', targetEntity: CartItemDebt::class, cascade: ['remove'])] private Collection $cartItemDebts; public function __construct() { $this->cartItemDebts = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getAmount(): ?float { return $this->amount; } public function setAmount(float $amount): self { $this->amount = $amount; return $this; } public function getPerson(): ?Person { return $this->person; } public function setPerson(?Person $person): self { $this->person = $person; return $this; } public function getSection(): ?Section { return $this->section; } public function setSection(?Section $section): self { $this->section = $section; return $this; } public function getSeason(): ?Season { return $this->season; } public function setSeason(?Season $season): self { $this->season = $season; return $this; } public function getAmountPayed(): ?float { return $this->amountPayed; } public function setAmountPayed(float $amountPayed): self { $this->amountPayed = $amountPayed; return $this; } public function getComment(): ?string { return $this->comment; } public function setComment(string $comment): self { $this->comment = $comment; return $this; } /** * @return Collection<int, CartItemDebt> */ public function getCartItemDebts(): Collection { return $this->cartItemDebts; } public function addCartItemDebt(CartItemDebt $cartItemDebt): self { if (!$this->cartItemDebts->contains($cartItemDebt)) { $this->cartItemDebts->add($cartItemDebt); $cartItemDebt->setDebt($this); } return $this; } public function removeCartItemDebt(CartItemDebt $cartItemDebt): self { if ($this->cartItemDebts->removeElement($cartItemDebt)) { // set the owning side to null (unless already changed) if ($cartItemDebt->getDebt() === $this) { $cartItemDebt->setDebt(null); } } return $this; }}