src/Entity/Task.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TaskRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=TaskRepository::class)
  9.  */
  10. class Task
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="integer")
  20.      */
  21.     private $idtask;
  22.     /**
  23.      * @ORM\Column(type="text")
  24.      */
  25.     private $title;
  26.     /**
  27.      * @ORM\Column(type="string", length=200)
  28.      */
  29.     private $start;
  30.      /**
  31.      * @ORM\Column(type="string", length=7)
  32.      */
  33.     private $backgroundcolor;
  34.     /**
  35.      * @ORM\Column(type="string", length=7)
  36.      */
  37.     private $bordercolor;
  38.     /**
  39.      * @ORM\Column(type="boolean", nullable=true)
  40.      */
  41.     private $isdone;
  42.     /**
  43.      * @ORM\ManyToOne(targetEntity=Site::class, inversedBy="calendarEvents")
  44.      */
  45.     private $site;
  46.     /**
  47.      * @ORM\ManyToOne(targetEntity=Task::class, inversedBy="tasks")
  48.      */
  49.     private $parent;
  50.     /**
  51.      * @ORM\OneToMany(targetEntity=Task::class, mappedBy="parent")
  52.      */
  53.     private $tasks;
  54.     /**
  55.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="tasks")
  56.      * @ORM\JoinColumn(nullable=false)
  57.      */
  58.     private $executant;
  59.     /**
  60.      * @ORM\Column(type="datetime_immutable")
  61.      */
  62.     private $created_at;
  63.     /**
  64.      * @ORM\Column(type="datetime_immutable", nullable=true)
  65.      */
  66.     private $updated_at;
  67.     /**
  68.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="tasksemit")
  69.      */
  70.     private $createdby;
  71.     /**
  72.      * @ORM\Column(type="boolean", nullable=true)
  73.      */
  74.     private $rappel;
  75.     public function __construct()
  76.     {
  77.         $this->tasks = new ArrayCollection();
  78.     }
  79.     public function getId(): ?int
  80.     {
  81.         return $this->id;
  82.     }
  83.     public function getIdtask(): ?int
  84.     {
  85.         return $this->idtask;
  86.     }
  87.     public function setIdtask(int $idtask): self
  88.     {
  89.         $this->idtask $idtask;
  90.         return $this;
  91.     }
  92.     public function getTitle(): ?string
  93.     {
  94.         return $this->title;
  95.     }
  96.     public function setTitle(string $title): self
  97.     {
  98.         $this->title $title;
  99.         return $this;
  100.     }
  101.     public function getStart(): ?string
  102.     {
  103.         return $this->start;
  104.     }
  105.     public function setStart(string $start): self
  106.     {
  107.         $this->start $start;
  108.         return $this;
  109.     }
  110.     public function getBackgroundcolor(): ?string
  111.     {
  112.         return $this->backgroundcolor;
  113.     }
  114.     public function setBackgroundcolor(string $backgroundcolor): self
  115.     {
  116.         $this->backgroundcolor $backgroundcolor;
  117.         return $this;
  118.     }
  119.     public function getBordercolor(): ?string
  120.     {
  121.         return $this->bordercolor;
  122.     }
  123.     public function setBordercolor(string $bordercolor): self
  124.     {
  125.         $this->bordercolor $bordercolor;
  126.         return $this;
  127.     }
  128.     public function isIsdone(): ?bool
  129.     {
  130.         return $this->isdone;
  131.     }
  132.     public function setIsdone(?bool $isdone): self
  133.     {
  134.         $this->isdone $isdone;
  135.         return $this;
  136.     }
  137.     public function getSite(): ?Site
  138.     {
  139.         return $this->site;
  140.     }
  141.     public function setSite(?Site $site): self
  142.     {
  143.         $this->site $site;
  144.         return $this;
  145.     }
  146.     public function getParent(): ?self
  147.     {
  148.         return $this->parent;
  149.     }
  150.     public function setParent(?self $parent): self
  151.     {
  152.         $this->parent $parent;
  153.         return $this;
  154.     }
  155.     /**
  156.      * @return Collection<int, self>
  157.      */
  158.     public function getTasks(): Collection
  159.     {
  160.         return $this->tasks;
  161.     }
  162.     public function addTask(self $task): self
  163.     {
  164.         if (!$this->tasks->contains($task)) {
  165.             $this->tasks[] = $task;
  166.             $task->setParent($this);
  167.         }
  168.         return $this;
  169.     }
  170.     public function removeTask(self $task): self
  171.     {
  172.         if ($this->tasks->removeElement($task)) {
  173.             // set the owning side to null (unless already changed)
  174.             if ($task->getParent() === $this) {
  175.                 $task->setParent(null);
  176.             }
  177.         }
  178.         return $this;
  179.     }
  180.     public function getExecutant(): ?User
  181.     {
  182.         return $this->executant;
  183.     }
  184.     public function setExecutant(?User $executant): self
  185.     {
  186.         $this->executant $executant;
  187.         return $this;
  188.     }
  189.     public function getCreatedAt(): ?\DateTimeImmutable
  190.     {
  191.         return $this->created_at;
  192.     }
  193.     public function setCreatedAt(\DateTimeImmutable $created_at): self
  194.     {
  195.         $this->created_at $created_at;
  196.         return $this;
  197.     }
  198.     public function getUpdatedAt(): ?\DateTimeImmutable
  199.     {
  200.         return $this->updated_at;
  201.     }
  202.     public function setUpdatedAt(?\DateTimeImmutable $updated_at): self
  203.     {
  204.         $this->updated_at $updated_at;
  205.         return $this;
  206.     }
  207.     public function getCreatedby(): ?User
  208.     {
  209.         return $this->createdby;
  210.     }
  211.     public function setCreatedby(?User $createdby): self
  212.     {
  213.         $this->createdby $createdby;
  214.         return $this;
  215.     }
  216.     public function isRappel(): ?bool
  217.     {
  218.         return $this->rappel;
  219.     }
  220.     public function setRappel(?bool $rappel): self
  221.     {
  222.         $this->rappel $rappel;
  223.         return $this;
  224.     }
  225. }