<?phpnamespace App\Entity;use App\Repository\RentalRepository;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: RentalRepository::class)]class Rental{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: 'integer')] private $id; #[ORM\Column(type: 'date_immutable')] private $startAt; #[ORM\Column(type: 'date_immutable')] private $endAt; #[ORM\Column(type: 'boolean')] private $isGivenBack; #[ORM\OneToOne(mappedBy: 'rental', targetEntity: TransactionRentalDepositCheck::class, cascade: ['persist', 'remove'])] private $transactionDepositCheck; #[ORM\OneToOne(mappedBy: 'rental', targetEntity: CartItemRental::class, cascade: ['persist', 'remove'])] private $cartItemRental; public function getId(): ?int { return $this->id; } public function getStartAt(): ?\DateTimeImmutable { return $this->startAt; } public function setStartAt(\DateTimeImmutable $startAt): self { $this->startAt = $startAt; return $this; } public function getEndAt(): ?\DateTimeImmutable { return $this->endAt; } public function setEndAt(\DateTimeImmutable $endAt): self { $this->endAt = $endAt; return $this; } public function getIsGivenBack(): ?bool { return $this->isGivenBack; } public function setIsGivenBack(bool $isGivenBack): self { $this->isGivenBack = $isGivenBack; return $this; } public function getTransactionDepositCheck(): ?TransactionRentalDepositCheck { return $this->transactionDepositCheck; } public function setTransactionDepositCheck(?TransactionRentalDepositCheck $transactionDepositCheck): self { // unset the owning side of the relation if necessary if ($transactionDepositCheck === null && $this->transactionDepositCheck !== null) { $this->transactionDepositCheck->setRental(null); } // set the owning side of the relation if necessary if ($transactionDepositCheck !== null && $transactionDepositCheck->getRental() !== $this) { $transactionDepositCheck->setRental($this); } $this->transactionDepositCheck = $transactionDepositCheck; return $this; } public function getCartItemRental(): ?CartItemRental { return $this->cartItemRental; } public function setCartItemRental(?CartItemRental $cartItemRental): self { // unset the owning side of the relation if necessary if ($cartItemRental === null && $this->cartItemRental !== null) { $this->cartItemRental->setRental(null); } // set the owning side of the relation if necessary if ($cartItemRental !== null && $cartItemRental->getRental() !== $this) { $cartItemRental->setRental($this); } $this->cartItemRental = $cartItemRental; return $this; } public function getItemVariation(): ?ItemVariation { return $this->getCartItemRental()?->getVariation(); }}