src/Entity/Rental.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\RentalRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassRentalRepository::class)]
  6. class Rental
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue]
  10.     #[ORM\Column(type'integer')]
  11.     private $id;
  12.     #[ORM\Column(type'date_immutable')]
  13.     private $startAt;
  14.     #[ORM\Column(type'date_immutable')]
  15.     private $endAt;
  16.     #[ORM\Column(type'boolean')]
  17.     private $isGivenBack;
  18.     #[ORM\OneToOne(mappedBy'rental'targetEntityTransactionRentalDepositCheck::class, cascade: ['persist''remove'])]
  19.     private $transactionDepositCheck;
  20.     #[ORM\OneToOne(mappedBy'rental'targetEntityCartItemRental::class, cascade: ['persist''remove'])]
  21.     private $cartItemRental;
  22.     public function getId(): ?int
  23.     {
  24.         return $this->id;
  25.     }
  26.     public function getStartAt(): ?\DateTimeImmutable
  27.     {
  28.         return $this->startAt;
  29.     }
  30.     public function setStartAt(\DateTimeImmutable $startAt): self
  31.     {
  32.         $this->startAt $startAt;
  33.         return $this;
  34.     }
  35.     public function getEndAt(): ?\DateTimeImmutable
  36.     {
  37.         return $this->endAt;
  38.     }
  39.     public function setEndAt(\DateTimeImmutable $endAt): self
  40.     {
  41.         $this->endAt $endAt;
  42.         return $this;
  43.     }
  44.     public function getIsGivenBack(): ?bool
  45.     {
  46.         return $this->isGivenBack;
  47.     }
  48.     public function setIsGivenBack(bool $isGivenBack): self
  49.     {
  50.         $this->isGivenBack $isGivenBack;
  51.         return $this;
  52.     }
  53.     public function getTransactionDepositCheck(): ?TransactionRentalDepositCheck
  54.     {
  55.         return $this->transactionDepositCheck;
  56.     }
  57.     public function setTransactionDepositCheck(?TransactionRentalDepositCheck $transactionDepositCheck): self
  58.     {
  59.         // unset the owning side of the relation if necessary
  60.         if ($transactionDepositCheck === null && $this->transactionDepositCheck !== null) {
  61.             $this->transactionDepositCheck->setRental(null);
  62.         }
  63.         // set the owning side of the relation if necessary
  64.         if ($transactionDepositCheck !== null && $transactionDepositCheck->getRental() !== $this) {
  65.             $transactionDepositCheck->setRental($this);
  66.         }
  67.         $this->transactionDepositCheck $transactionDepositCheck;
  68.         return $this;
  69.     }
  70.     public function getCartItemRental(): ?CartItemRental
  71.     {
  72.         return $this->cartItemRental;
  73.     }
  74.     public function setCartItemRental(?CartItemRental $cartItemRental): self
  75.     {
  76.         // unset the owning side of the relation if necessary
  77.         if ($cartItemRental === null && $this->cartItemRental !== null) {
  78.             $this->cartItemRental->setRental(null);
  79.         }
  80.         // set the owning side of the relation if necessary
  81.         if ($cartItemRental !== null && $cartItemRental->getRental() !== $this) {
  82.             $cartItemRental->setRental($this);
  83.         }
  84.         $this->cartItemRental $cartItemRental;
  85.         return $this;
  86.     }
  87.     public function getItemVariation(): ?ItemVariation
  88.     {
  89.         return $this->getCartItemRental()?->getVariation();
  90.     }
  91. }