<?php
namespace App\Entity;
use App\Repository\TaskRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=TaskRepository::class)
*/
class Task
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="integer")
*/
private $idtask;
/**
* @ORM\Column(type="text")
*/
private $title;
/**
* @ORM\Column(type="string", length=200)
*/
private $start;
/**
* @ORM\Column(type="string", length=7)
*/
private $backgroundcolor;
/**
* @ORM\Column(type="string", length=7)
*/
private $bordercolor;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isdone;
/**
* @ORM\ManyToOne(targetEntity=Site::class, inversedBy="calendarEvents")
*/
private $site;
/**
* @ORM\ManyToOne(targetEntity=Task::class, inversedBy="tasks")
*/
private $parent;
/**
* @ORM\OneToMany(targetEntity=Task::class, mappedBy="parent")
*/
private $tasks;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="tasks")
* @ORM\JoinColumn(nullable=false)
*/
private $executant;
/**
* @ORM\Column(type="datetime_immutable")
*/
private $created_at;
/**
* @ORM\Column(type="datetime_immutable", nullable=true)
*/
private $updated_at;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="tasksemit")
*/
private $createdby;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $rappel;
public function __construct()
{
$this->tasks = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getIdtask(): ?int
{
return $this->idtask;
}
public function setIdtask(int $idtask): self
{
$this->idtask = $idtask;
return $this;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
public function getStart(): ?string
{
return $this->start;
}
public function setStart(string $start): self
{
$this->start = $start;
return $this;
}
public function getBackgroundcolor(): ?string
{
return $this->backgroundcolor;
}
public function setBackgroundcolor(string $backgroundcolor): self
{
$this->backgroundcolor = $backgroundcolor;
return $this;
}
public function getBordercolor(): ?string
{
return $this->bordercolor;
}
public function setBordercolor(string $bordercolor): self
{
$this->bordercolor = $bordercolor;
return $this;
}
public function isIsdone(): ?bool
{
return $this->isdone;
}
public function setIsdone(?bool $isdone): self
{
$this->isdone = $isdone;
return $this;
}
public function getSite(): ?Site
{
return $this->site;
}
public function setSite(?Site $site): self
{
$this->site = $site;
return $this;
}
public function getParent(): ?self
{
return $this->parent;
}
public function setParent(?self $parent): self
{
$this->parent = $parent;
return $this;
}
/**
* @return Collection<int, self>
*/
public function getTasks(): Collection
{
return $this->tasks;
}
public function addTask(self $task): self
{
if (!$this->tasks->contains($task)) {
$this->tasks[] = $task;
$task->setParent($this);
}
return $this;
}
public function removeTask(self $task): self
{
if ($this->tasks->removeElement($task)) {
// set the owning side to null (unless already changed)
if ($task->getParent() === $this) {
$task->setParent(null);
}
}
return $this;
}
public function getExecutant(): ?User
{
return $this->executant;
}
public function setExecutant(?User $executant): self
{
$this->executant = $executant;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->created_at;
}
public function setCreatedAt(\DateTimeImmutable $created_at): self
{
$this->created_at = $created_at;
return $this;
}
public function getUpdatedAt(): ?\DateTimeImmutable
{
return $this->updated_at;
}
public function setUpdatedAt(?\DateTimeImmutable $updated_at): self
{
$this->updated_at = $updated_at;
return $this;
}
public function getCreatedby(): ?User
{
return $this->createdby;
}
public function setCreatedby(?User $createdby): self
{
$this->createdby = $createdby;
return $this;
}
public function isRappel(): ?bool
{
return $this->rappel;
}
public function setRappel(?bool $rappel): self
{
$this->rappel = $rappel;
return $this;
}
}