src/Entity/PatchfieldGroup.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Table(name'patchfieldgroup')]
  7. #[ORM\Entity(repositoryClass'App\Entity\Repository\PatchfieldGroupRepository')]
  8. class PatchfieldGroup
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\Column(type'integer')]
  12.     #[ORM\GeneratedValue(strategy'AUTO')]
  13.     private $id;
  14.     #[ORM\Column(type'date'nullabletrue)]
  15.     private $date_last_watering_notification;
  16.     #[ORM\Column(type'integer'nullabletrue)]
  17.     private $seeding_distance;
  18.     #[ORM\Column(type'float'nullabletrue)]
  19.     private $row_distance;
  20.     #[ORM\Column(type'integer'nullabletrue)]
  21.     private $width;
  22.     #[ORM\Column(type'integer'nullabletrue)]
  23.     private $length;
  24.     #[ORM\Column(type'datetime'nullabletrue)]
  25.     private $date_created;
  26.     #[ORM\OneToMany(targetEntity'App\Entity\Patchfield'mappedBy'patchfieldGroup')]
  27.     private $patchfield;
  28.     #[ORM\OneToMany(targetEntity'App\Entity\Todo'mappedBy'patchfieldGroup'cascade: ['all'])]
  29.     private $todo;
  30.     #[ORM\ManyToOne(targetEntity'App\Entity\Patch'inversedBy'patchfieldGroup')]
  31.     #[ORM\JoinColumn(name'patch_id'referencedColumnName'id'nullablefalse)]
  32.     private $patch;
  33.     public function __construct()
  34.     {
  35.         $this->patchfield = new ArrayCollection();
  36.         $this->todo = new ArrayCollection();
  37.     }
  38.     public function __clone() {
  39.         $this->id null;
  40.         $this->patchfield = new ArrayCollection();
  41.         $this->todo = new ArrayCollection();
  42.     }
  43.     public function getId(): ?int
  44.     {
  45.         return $this->id;
  46.     }
  47.     public function getDateCreated(): ?\DateTimeInterface
  48.     {
  49.         return $this->date_created;
  50.     }
  51.     public function setDateCreated(?\DateTimeInterface $date_created): self
  52.     {
  53.         $this->date_created $date_created;
  54.         return $this;
  55.     }
  56.     /**
  57.      * @return Collection|Patchfield[]
  58.      */
  59.     public function getPatchfield(): Collection
  60.     {
  61.         return $this->patchfield;
  62.     }
  63.     public function addPatchfield(Patchfield $patchfield): self
  64.     {
  65.         if (!$this->patchfield->contains($patchfield)) {
  66.             $this->patchfield[] = $patchfield;
  67.             $patchfield->setPatchfieldGroup($this);
  68.         }
  69.         return $this;
  70.     }
  71.     public function removePatchfield(Patchfield $patchfield): self
  72.     {
  73.         if ($this->patchfield->contains($patchfield)) {
  74.             $this->patchfield->removeElement($patchfield);
  75.             // set the owning side to null (unless already changed)
  76.             if ($patchfield->getPatchfieldGroup() === $this) {
  77.                 $patchfield->setPatchfieldGroup(null);
  78.             }
  79.         }
  80.         return $this;
  81.     }
  82.     /**
  83.      * @return Collection|Todo[]
  84.      */
  85.     public function getTodo(): Collection
  86.     {
  87.         return $this->todo;
  88.     }
  89.     public function addTodo(Todo $todo): self
  90.     {
  91.         if (!$this->todo->contains($todo)) {
  92.             $this->todo[] = $todo;
  93.             $todo->setPatchfieldGroup($this);
  94.         }
  95.         return $this;
  96.     }
  97.     public function removeTodo(Todo $todo): self
  98.     {
  99.         if ($this->todo->contains($todo)) {
  100.             $this->todo->removeElement($todo);
  101.             // set the owning side to null (unless already changed)
  102.             if ($todo->getPatchfieldGroup() === $this) {
  103.                 $todo->setPatchfieldGroup(null);
  104.             }
  105.         }
  106.         return $this;
  107.     }
  108.     public function getPatch(): ?Patch
  109.     {
  110.         return $this->patch;
  111.     }
  112.     public function setPatch(?Patch $patch): self
  113.     {
  114.         $this->patch $patch;
  115.         return $this;
  116.     }
  117.     public function getDateLastWateringNotification(): ?\DateTimeInterface
  118.     {
  119.         return $this->date_last_watering_notification;
  120.     }
  121.     public function setDateLastWateringNotification(?\DateTimeInterface $date_last_watering_notification): self
  122.     {
  123.         $this->date_last_watering_notification $date_last_watering_notification;
  124.         return $this;
  125.     }
  126.     public function getSeedingDistance(): ?int
  127.     {
  128.         return $this->seeding_distance;
  129.     }
  130.     public function setSeedingDistance(?int $seeding_distance): self
  131.     {
  132.         $this->seeding_distance $seeding_distance;
  133.         return $this;
  134.     }
  135.     public function getRowDistance(): ?float
  136.     {
  137.         return $this->row_distance;
  138.     }
  139.     public function setRowDistance(?float $row_distance): self
  140.     {
  141.         $this->row_distance $row_distance;
  142.         return $this;
  143.     }
  144.     public function getWidth(): ?int
  145.     {
  146.         return $this->width;
  147.     }
  148.     public function setWidth(?int $width): self
  149.     {
  150.         $this->width $width;
  151.         return $this;
  152.     }
  153.     public function getLength(): ?int
  154.     {
  155.         return $this->length;
  156.     }
  157.     public function setLength(?int $length): self
  158.     {
  159.         $this->length $length;
  160.         return $this;
  161.     }
  162. }