src/Entity/Rental.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\RentalRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass=RentalRepository::class)
  8.  */
  9. class Rental
  10. {
  11.     /**
  12.      * @ORM\Id
  13.      * @ORM\GeneratedValue
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\OneToOne(targetEntity=User::class, inversedBy="rental", cascade={"persist"})
  19.      * @ORM\JoinColumn(nullable=false)
  20.      */
  21.     private $tenant;
  22.     /**
  23.      * @ORM\OneToOne(targetEntity=Properties::class, inversedBy="rental", cascade={"persist", "remove"})
  24.      * @ORM\JoinColumn(nullable=false)
  25.      */
  26.     private $property;
  27.     /**
  28.      * @ORM\Column(type="datetime")
  29.      */
  30.     private $dateStart;
  31.     /**
  32.      * @ORM\Column(type="datetime")
  33.      */
  34.     private $dateEnd;
  35.     /**
  36.      * @ORM\OneToOne(targetEntity=Rent::class, mappedBy="rental", cascade={"persist", "remove"})
  37.      */
  38.     private $rent;
  39.     public function getId(): ?int
  40.     {
  41.         return $this->id;
  42.     }
  43.     public function getTenant(): ?User
  44.     {
  45.         return $this->tenant;
  46.     }
  47.     public function setTenant(User $tenant): self
  48.     {
  49.         $this->tenant $tenant;
  50.         return $this;
  51.     }
  52.     public function getProperty(): ?Properties
  53.     {
  54.         return $this->property;
  55.     }
  56.     public function setProperty(Properties $property): self
  57.     {
  58.         $this->property $property;
  59.         return $this;
  60.     }
  61.     public function getDateStart(): ?\DateTime
  62.     {
  63.         return $this->dateStart;
  64.     }
  65.     public function setDateStart(\DateTime $dateStart): self
  66.     {
  67.         $this->dateStart $dateStart;
  68.         return $this;
  69.     }
  70.     public function getDateEnd(): ?\DateTime
  71.     {
  72.         return $this->dateEnd;
  73.     }
  74.     public function setDateEnd(\DateTime $dateEnd): self
  75.     {
  76.         $this->dateEnd $dateEnd;
  77.         return $this;
  78.     }
  79.     public function getRent(): ?Rent
  80.     {
  81.         return $this->rent;
  82.     }
  83.     public function setRent(Rent $rent): self
  84.     {
  85.         // set the owning side of the relation if necessary
  86.         if ($rent->getRental() !== $this) {
  87.             $rent->setRental($this);
  88.         }
  89.         $this->rent $rent;
  90.         return $this;
  91.     }
  92. }