<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Table(name: 'patchfieldgroup')]
#[ORM\Entity(repositoryClass: 'App\Entity\Repository\PatchfieldGroupRepository')]
class PatchfieldGroup
{
#[ORM\Id]
#[ORM\Column(type: 'integer')]
#[ORM\GeneratedValue(strategy: 'AUTO')]
private $id;
#[ORM\Column(type: 'date', nullable: true)]
private $date_last_watering_notification;
#[ORM\Column(type: 'integer', nullable: true)]
private $seeding_distance;
#[ORM\Column(type: 'float', nullable: true)]
private $row_distance;
#[ORM\Column(type: 'integer', nullable: true)]
private $width;
#[ORM\Column(type: 'integer', nullable: true)]
private $length;
#[ORM\Column(type: 'datetime', nullable: true)]
private $date_created;
#[ORM\OneToMany(targetEntity: 'App\Entity\Patchfield', mappedBy: 'patchfieldGroup')]
private $patchfield;
#[ORM\OneToMany(targetEntity: 'App\Entity\Todo', mappedBy: 'patchfieldGroup', cascade: ['all'])]
private $todo;
#[ORM\ManyToOne(targetEntity: 'App\Entity\Patch', inversedBy: 'patchfieldGroup')]
#[ORM\JoinColumn(name: 'patch_id', referencedColumnName: 'id', nullable: false)]
private $patch;
public function __construct()
{
$this->patchfield = new ArrayCollection();
$this->todo = new ArrayCollection();
}
public function __clone() {
$this->id = null;
$this->patchfield = new ArrayCollection();
$this->todo = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getDateCreated(): ?\DateTimeInterface
{
return $this->date_created;
}
public function setDateCreated(?\DateTimeInterface $date_created): self
{
$this->date_created = $date_created;
return $this;
}
/**
* @return Collection|Patchfield[]
*/
public function getPatchfield(): Collection
{
return $this->patchfield;
}
public function addPatchfield(Patchfield $patchfield): self
{
if (!$this->patchfield->contains($patchfield)) {
$this->patchfield[] = $patchfield;
$patchfield->setPatchfieldGroup($this);
}
return $this;
}
public function removePatchfield(Patchfield $patchfield): self
{
if ($this->patchfield->contains($patchfield)) {
$this->patchfield->removeElement($patchfield);
// set the owning side to null (unless already changed)
if ($patchfield->getPatchfieldGroup() === $this) {
$patchfield->setPatchfieldGroup(null);
}
}
return $this;
}
/**
* @return Collection|Todo[]
*/
public function getTodo(): Collection
{
return $this->todo;
}
public function addTodo(Todo $todo): self
{
if (!$this->todo->contains($todo)) {
$this->todo[] = $todo;
$todo->setPatchfieldGroup($this);
}
return $this;
}
public function removeTodo(Todo $todo): self
{
if ($this->todo->contains($todo)) {
$this->todo->removeElement($todo);
// set the owning side to null (unless already changed)
if ($todo->getPatchfieldGroup() === $this) {
$todo->setPatchfieldGroup(null);
}
}
return $this;
}
public function getPatch(): ?Patch
{
return $this->patch;
}
public function setPatch(?Patch $patch): self
{
$this->patch = $patch;
return $this;
}
public function getDateLastWateringNotification(): ?\DateTimeInterface
{
return $this->date_last_watering_notification;
}
public function setDateLastWateringNotification(?\DateTimeInterface $date_last_watering_notification): self
{
$this->date_last_watering_notification = $date_last_watering_notification;
return $this;
}
public function getSeedingDistance(): ?int
{
return $this->seeding_distance;
}
public function setSeedingDistance(?int $seeding_distance): self
{
$this->seeding_distance = $seeding_distance;
return $this;
}
public function getRowDistance(): ?float
{
return $this->row_distance;
}
public function setRowDistance(?float $row_distance): self
{
$this->row_distance = $row_distance;
return $this;
}
public function getWidth(): ?int
{
return $this->width;
}
public function setWidth(?int $width): self
{
$this->width = $width;
return $this;
}
public function getLength(): ?int
{
return $this->length;
}
public function setLength(?int $length): self
{
$this->length = $length;
return $this;
}
}