src/Entity/HomeInterest.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\HomeInterestRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=HomeInterestRepository::class)
  9.  */
  10. class HomeInterest
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="homeInterests")
  20.      * @ORM\JoinColumn(nullable=false)
  21.      */
  22.     private $user;
  23.     /**
  24.      * @ORM\ManyToMany(targetEntity=Properties::class, inversedBy="homeInterests", cascade={"remove"})
  25.      */
  26.     private $properties;
  27.     /**
  28.      * @ORM\Column(type="boolean")
  29.      */
  30.     private $financing;
  31.     /**
  32.      * @ORM\Column(type="boolean")
  33.      */
  34.     private $financialContribution;
  35.         /**
  36.      * @ORM\Column(type="integer")
  37.      */
  38.     private $priceContribution;
  39.     public function __construct()
  40.     {
  41.         $this->properties = new ArrayCollection();
  42.     }
  43.     public function getId(): ?int
  44.     {
  45.         return $this->id;
  46.     }
  47.     public function getUser(): ?User
  48.     {
  49.         return $this->user;
  50.     }
  51.     public function setUser(?User $user): self
  52.     {
  53.         $this->user $user;
  54.         return $this;
  55.     }
  56.     /**
  57.      * @return Collection<int, Properties>
  58.      */
  59.     public function getProperties(): Collection
  60.     {
  61.         return $this->properties;
  62.     }
  63.     public function addProperty(Properties $property): self
  64.     {
  65.         if (!$this->properties->contains($property)) {
  66.             $this->properties[] = $property;
  67.         }
  68.         return $this;
  69.     }
  70.     public function removeProperty(Properties $property): self
  71.     {
  72.         $this->properties->removeElement($property);
  73.         return $this;
  74.     }
  75.     public function isFinancing(): ?bool
  76.     {
  77.         return $this->financing;
  78.     }
  79.     public function setFinancing(bool $financing): self
  80.     {
  81.         $this->financing $financing;
  82.         return $this;
  83.     }
  84.     public function isFinancialContribution(): ?bool
  85.     {
  86.         return $this->financialContribution;
  87.     }
  88.     public function setFinancialContribution(bool $financialContribution): self
  89.     {
  90.         $this->financialContribution $financialContribution;
  91.         return $this;
  92.     }
  93.     
  94.     /**
  95.      * Get the value of priceContribution
  96.      */ 
  97.     public function getPriceContribution()
  98.     {
  99.         return $this->priceContribution;
  100.     }
  101.     /**
  102.      * Set the value of priceContribution
  103.      *
  104.      * @return  self
  105.      */ 
  106.     public function setPriceContribution($priceContribution)
  107.     {
  108.         $this->priceContribution $priceContribution;
  109.         return $this;
  110.     }
  111. }