src/Entity/WateringTips/WateringTips.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity\WateringTips;
  3. use App\Entity\PostAwareInterface;
  4. use App\Entity\User;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  7. /**
  8.  * @ORM\Entity(repositoryClass="App\Repository\App\WateringTipsRepository")
  9.  * @ORM\Table(
  10.  *      name="WateringTips",
  11.  *      uniqueConstraints={@ORM\UniqueConstraint(name="userPostTown", columns={"user_id", "town", "postNumber"})}
  12.  *  )
  13.  * @UniqueEntity(fields={"user", "town", "postNumber"})
  14.  */
  15. class WateringTips implements PostAwareInterface
  16. {
  17.     /**
  18.      * @ORM\Id
  19.      * @ORM\GeneratedValue
  20.      * @ORM\Column(type="integer")
  21.      */
  22.     private ?int $id;
  23.     /**
  24.      * @ORM\ManyToOne(targetEntity="App\Entity\User")
  25.      * @ORM\JoinColumn(nullable=false)
  26.      */
  27.     private User $user;
  28.     /**
  29.      * @ORM\Column(type="string", length=255, nullable=true)
  30.      */
  31.     private ?string $town;
  32.     /**
  33.      * @ORM\Column(type="string", length=255, nullable=true)
  34.      */
  35.     private ?string $postNumber;
  36.     /**
  37.      * @ORM\Column(type="boolean", nullable=false)
  38.      */
  39.     private bool $isReference false;
  40.     /**
  41.      * @ORM\Column(type="integer", nullable=false)
  42.      */
  43.     private int $nbFruitTrees 0;
  44.     /**
  45.      * @ORM\Column(type="integer", nullable=false)
  46.      */
  47.     private int $nbOliveTrees 0;
  48.     /**
  49.      * @ORM\Column(type="integer", nullable=false)
  50.      */
  51.     private int $flowerBedArea 0;
  52.     /**
  53.      * @ORM\Column(type="integer", nullable=false)
  54.      */
  55.     private int $mediterraneanPlantArea 0;
  56.     /**
  57.      * @ORM\Column(type="integer", nullable=false)
  58.      */
  59.     private int $lawnArea 0;
  60.     /**
  61.      * @ORM\Column(type="integer", nullable=false)
  62.      */
  63.     private int $vegetableGardenArea 0;
  64.     public function getId(): ?int
  65.     {
  66.         return $this->id;
  67.     }
  68.     public function setId(int $id): self
  69.     {
  70.         $this->id $id;
  71.         return $this;
  72.     }
  73.     public function getUser(): User
  74.     {
  75.         return $this->user;
  76.     }
  77.     public function setUser(User $user): self
  78.     {
  79.         $this->user $user;
  80.         return $this;
  81.     }
  82.     public function getTown(): ?string
  83.     {
  84.         return $this->town;
  85.     }
  86.     public function setTown(?string $town): self
  87.     {
  88.         $this->town $town;
  89.         return $this;
  90.     }
  91.     public function getPostNumber(): ?string
  92.     {
  93.         return $this->postNumber;
  94.     }
  95.     public function setPostNumber(?string $postNumber): self
  96.     {
  97.         $this->postNumber $postNumber;
  98.         return $this;
  99.     }
  100.     public function isReference(): bool
  101.     {
  102.         return $this->isReference;
  103.     }
  104.     public function setIsReference(bool $isReference): self
  105.     {
  106.         $this->isReference $isReference;
  107.         return $this;
  108.     }
  109.     public function getNbFruitTrees(): int
  110.     {
  111.         return $this->nbFruitTrees;
  112.     }
  113.     public function setNbFruitTrees(int $nbFruitTrees): self
  114.     {
  115.         $this->nbFruitTrees $nbFruitTrees;
  116.         return $this;
  117.     }
  118.     public function getNbOliveTrees(): int
  119.     {
  120.         return $this->nbOliveTrees;
  121.     }
  122.     public function setNbOliveTrees(int $nbOliveTrees): self
  123.     {
  124.         $this->nbOliveTrees $nbOliveTrees;
  125.         return $this;
  126.     }
  127.     public function getFlowerBedArea(): int
  128.     {
  129.         return $this->flowerBedArea;
  130.     }
  131.     public function setFlowerBedArea(int $flowerBedArea): self
  132.     {
  133.         $this->flowerBedArea $flowerBedArea;
  134.         return $this;
  135.     }
  136.     public function getMediterraneanPlantArea(): int
  137.     {
  138.         return $this->mediterraneanPlantArea;
  139.     }
  140.     public function setMediterraneanPlantArea(int $mediterraneanPlantArea): self
  141.     {
  142.         $this->mediterraneanPlantArea $mediterraneanPlantArea;
  143.         return $this;
  144.     }
  145.     public function getLawnArea(): int
  146.     {
  147.         return $this->lawnArea;
  148.     }
  149.     public function setLawnArea(int $lawnArea): self
  150.     {
  151.         $this->lawnArea $lawnArea;
  152.         return $this;
  153.     }
  154.     public function getVegetableGardenArea(): int
  155.     {
  156.         return $this->vegetableGardenArea;
  157.     }
  158.     public function setVegetableGardenArea(int $vegetableGardenArea): self
  159.     {
  160.         $this->vegetableGardenArea $vegetableGardenArea;
  161.         return $this;
  162.     }
  163. }