src/Entity/ChecklistTask.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ChecklistTaskRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassChecklistTaskRepository::class)]
  9. class ChecklistTask
  10. {
  11.     public const PRIORITY_LOW 'LOW';
  12.     public const PRIORITY_MEDIUM 'MEDIUM';
  13.     public const PRIORITY_HIGH 'HIGH';
  14.     // Enum values for ChecklistVisibility
  15.     public const VISIBILITY_PUBLIC 'PUBLIC';
  16.     public const VISIBILITY_PRIVATE 'PRIVATE';
  17.     // Enum values for DependantOn
  18.     public const CHECKLIST_START_DATE 'CHECKLIST_START_DATE';
  19.     public const CHECKLIST_END_DATE 'CHECKLIST_END_DATE';
  20.     public const TASK 'TASK';
  21.     #[ORM\Id]
  22.     #[ORM\GeneratedValue]
  23.     #[ORM\Column]
  24.     private ?int $id null;
  25.     #[ORM\Column(length255)]
  26.     private ?string $name null;
  27.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  28.     private ?string $description null;
  29.     #[ORM\Column(length30nullabletrue)]
  30.     private ?string $priority null;
  31.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  32.     private ?\DateTimeInterface $dueDate null;
  33.     #[ORM\Column(nullabletrue)]
  34.     private ?string $status null;
  35.     #[ORM\Column(nullabletrue)]
  36.     private ?string $dependantOn null;
  37.     #[ORM\Column(length10nullabletrue)]
  38.     private ?string $visibility null;
  39.     #[ORM\Column(nullabletrue)]
  40.     private ?bool $requireDocument null;
  41.     #[ORM\Column(nullabletrue)]
  42.     private ?int $position null;
  43.     #[ORM\OneToMany(mappedBy'task'targetEntityChecklistHowTo::class, orphanRemovaltrue)]
  44.     private Collection $checklistHowTos;
  45.     #[ORM\OneToMany(mappedBy'task'targetEntityChecklistTaskDependency::class, orphanRemovaltrue)]
  46.     private Collection $taskDependencies;
  47.     #[ORM\OneToMany(mappedBy'taskParent'targetEntityChecklistTaskDependency::class, orphanRemovaltrue)]
  48.     private Collection $taskDependencyAsParent;
  49.     #[ORM\ManyToOne(inversedBy'tasks')]
  50.     #[ORM\JoinColumn(nullablefalseonDelete'CASCADE')]
  51.     private ?Checklist $checklist null;
  52.     #[ORM\ManyToOne(inversedBy'checklistTasksAsAssignee')]
  53.     private ?User $defaultAssignee null;
  54.     #[ORM\ManyToOne(inversedBy'checklistTaskAsVerifier')]
  55.     private ?User $verifier null;
  56.     #[ORM\Column(length255nullabletrue)]
  57.     private ?string $document null;
  58.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  59.     private ?string $comment null;
  60.     #[ORM\OneToMany(mappedBy'task'targetEntityChecklistActivity::class)]
  61.     private Collection $checklistActivities;
  62.     #[ORM\OneToMany(mappedBy'task'targetEntityChecklistNotification::class)]
  63.     private Collection $checklistNotifications;
  64.     #[ORM\Column(nullabletrue)]
  65.     private ?int $offsetInDays null;
  66.     #[ORM\ManyToOne(targetEntityself::class, inversedBy'offsetTasks')]
  67.     #[ORM\JoinColumn(onDelete'SET NULL')]
  68.     private ?self $offsetTask null;
  69.     #[ORM\OneToMany(mappedBy'offsetTask'targetEntityself::class)]
  70.     private Collection $offsetTasks;
  71.     #[ORM\Column(nullabletrue)]
  72.     private ?\DateTimeImmutable $startDate null;
  73.     #[ORM\Column(nullabletrue)]
  74.     private ?int $durationInDays null;
  75.     #[ORM\OneToMany(mappedBy'task'targetEntityProjectDynamicField::class, orphanRemovaltrue)]
  76.     private Collection $projectDynamicFields;
  77.     public function __construct()
  78.     {
  79.         $this->checklistHowTos = new ArrayCollection();
  80.         $this->taskDependencies = new ArrayCollection();
  81.         $this->taskDependencyAsParent = new ArrayCollection();
  82.         $this->checklistActivities = new ArrayCollection();
  83.         $this->checklistNotifications = new ArrayCollection();
  84.         $this->offsetTasks = new ArrayCollection();
  85.         $this->projectDynamicFields = new ArrayCollection();
  86.     }
  87.     public function getId(): ?int
  88.     {
  89.         return $this->id;
  90.     }
  91.     public function getName(): ?string
  92.     {
  93.         return $this->name;
  94.     }
  95.     public function setName(string $name): self
  96.     {
  97.         $this->name $name;
  98.         return $this;
  99.     }
  100.     public function getDescription(): ?string
  101.     {
  102.         return $this->description;
  103.     }
  104.     public function setDescription(?string $description): self
  105.     {
  106.         $this->description $description;
  107.         return $this;
  108.     }
  109.     public function getPriority(): ?string
  110.     {
  111.         return $this->priority;
  112.     }
  113.     public function setPriority(?string $priority): self
  114.     {
  115.         $this->priority $priority;
  116.         return $this;
  117.     }
  118.     public function getDueDate(): ?\DateTimeInterface
  119.     {
  120.         return $this->dueDate;
  121.     }
  122.     public function setDueDate(?\DateTimeInterface $dueDate): self
  123.     {
  124.         $this->dueDate $dueDate;
  125.         return $this;
  126.     }
  127.     public function getVisibility(): ?string
  128.     {
  129.         return $this->visibility;
  130.     }
  131.     public function setVisibility(?string $visibility): self
  132.     {
  133.         $this->visibility $visibility;
  134.         return $this;
  135.     }
  136.     public function isRequireDocument(): ?bool
  137.     {
  138.         return $this->requireDocument;
  139.     }
  140.     public function setRequireDocument(?bool $requireDocument): self
  141.     {
  142.         $this->requireDocument $requireDocument;
  143.         return $this;
  144.     }
  145.     public function getPosition(): ?int
  146.     {
  147.         return $this->position;
  148.     }
  149.     public function setPosition(?int $position): self
  150.     {
  151.         $this->position $position;
  152.         return $this;
  153.     }
  154.     /**
  155.      * @return Collection<int, ChecklistHowTo>
  156.      */
  157.     public function getChecklistHowTos(): Collection
  158.     {
  159.         return $this->checklistHowTos;
  160.     }
  161.     public function addChecklistHowTo(ChecklistHowTo $checklistHowTo): self
  162.     {
  163.         if (!$this->checklistHowTos->contains($checklistHowTo)) {
  164.             $this->checklistHowTos->add($checklistHowTo);
  165.             $checklistHowTo->setTask($this);
  166.         }
  167.         return $this;
  168.     }
  169.     public function removeChecklistHowTo(ChecklistHowTo $checklistHowTo): self
  170.     {
  171.         if ($this->checklistHowTos->removeElement($checklistHowTo)) {
  172.             // set the owning side to null (unless already changed)
  173.             if ($checklistHowTo->getTask() === $this) {
  174.                 $checklistHowTo->setTask(null);
  175.             }
  176.         }
  177.         return $this;
  178.     }
  179.     /**
  180.      * @return Collection<int, ChecklistTaskDependency>
  181.      */
  182.     public function getTaskDependencies(): Collection
  183.     {
  184.         return $this->taskDependencies;
  185.     }
  186.     public function addTaskDependency(ChecklistTaskDependency $taskDependency): self
  187.     {
  188.         if (!$this->taskDependencies->contains($taskDependency)) {
  189.             $this->taskDependencies->add($taskDependency);
  190.             $taskDependency->setTask($this);
  191.         }
  192.         return $this;
  193.     }
  194.     public function removeTaskDependency(ChecklistTaskDependency $taskDependency): self
  195.     {
  196.         if ($this->taskDependencies->removeElement($taskDependency)) {
  197.             // set the owning side to null (unless already changed)
  198.             if ($taskDependency->getTask() === $this) {
  199.                 $taskDependency->setTask(null);
  200.             }
  201.         }
  202.         return $this;
  203.     }
  204.     /**
  205.      * @return Collection<int, ChecklistTaskDependency>
  206.      */
  207.     public function getTaskDependencyAsParent(): Collection
  208.     {
  209.         return $this->taskDependencyAsParent;
  210.     }
  211.     public function addTaskDependencyAsParent(ChecklistTaskDependency $taskDependencyAsParent): self
  212.     {
  213.         if (!$this->taskDependencyAsParent->contains($taskDependencyAsParent)) {
  214.             $this->taskDependencyAsParent->add($taskDependencyAsParent);
  215.             $taskDependencyAsParent->setTaskParent($this);
  216.         }
  217.         return $this;
  218.     }
  219.     public function removeTaskDependencyAsParent(ChecklistTaskDependency $taskDependencyAsParent): self
  220.     {
  221.         if ($this->taskDependencyAsParent->removeElement($taskDependencyAsParent)) {
  222.             // set the owning side to null (unless already changed)
  223.             if ($taskDependencyAsParent->getTaskParent() === $this) {
  224.                 $taskDependencyAsParent->setTaskParent(null);
  225.             }
  226.         }
  227.         return $this;
  228.     }
  229.     public function getChecklist(): ?Checklist
  230.     {
  231.         return $this->checklist;
  232.     }
  233.     public function setChecklist(?Checklist $checklist): self
  234.     {
  235.         $this->checklist $checklist;
  236.         return $this;
  237.     }
  238.     public function getDefaultAssignee(): ?User
  239.     {
  240.         return $this->defaultAssignee;
  241.     }
  242.     public function setDefaultAssignee(?User $defaultAssignee): self
  243.     {
  244.         $this->defaultAssignee $defaultAssignee;
  245.         return $this;
  246.     }
  247.     public function getVerifier(): ?User
  248.     {
  249.         return $this->verifier;
  250.     }
  251.     public function setVerifier(?User $verifier): self
  252.     {
  253.         $this->verifier $verifier;
  254.         return $this;
  255.     }
  256.     public function getDocument(): ?string
  257.     {
  258.         return $this->document;
  259.     }
  260.     public function setDocument(?string $document): self
  261.     {
  262.         $this->document $document;
  263.         return $this;
  264.     }
  265.     public function getStatus(): ?string
  266.     {
  267.         return $this->status;
  268.     }
  269.     public function setStatus(?string $status): void
  270.     {
  271.         $this->status $status;
  272.     }
  273.     public function getComment(): ?string
  274.     {
  275.         return $this->comment;
  276.     }
  277.     public function setComment(?string $comment): self
  278.     {
  279.         $this->comment $comment;
  280.         return $this;
  281.     }
  282.     /**
  283.      * @return Collection<int, ChecklistActivity>
  284.      */
  285.     public function getChecklistActivities(): Collection
  286.     {
  287.         return $this->checklistActivities;
  288.     }
  289.     public function addChecklistActivity(ChecklistActivity $checklistActivity): self
  290.     {
  291.         if (!$this->checklistActivities->contains($checklistActivity)) {
  292.             $this->checklistActivities->add($checklistActivity);
  293.             $checklistActivity->setTask($this);
  294.         }
  295.         return $this;
  296.     }
  297.     public function removeChecklistActivity(ChecklistActivity $checklistActivity): self
  298.     {
  299.         if ($this->checklistActivities->removeElement($checklistActivity)) {
  300.             // set the owning side to null (unless already changed)
  301.             if ($checklistActivity->getTask() === $this) {
  302.                 $checklistActivity->setTask(null);
  303.             }
  304.         }
  305.         return $this;
  306.     }
  307.     /**
  308.      * @return Collection<int, ChecklistNotification>
  309.      */
  310.     public function getChecklistNotifications(): Collection
  311.     {
  312.         return $this->checklistNotifications;
  313.     }
  314.     public function addChecklistNotification(ChecklistNotification $checklistNotification): self
  315.     {
  316.         if (!$this->checklistNotifications->contains($checklistNotification)) {
  317.             $this->checklistNotifications->add($checklistNotification);
  318.             $checklistNotification->setTask($this);
  319.         }
  320.         return $this;
  321.     }
  322.     public function removeChecklistNotification(ChecklistNotification $checklistNotification): self
  323.     {
  324.         if ($this->checklistNotifications->removeElement($checklistNotification)) {
  325.             // set the owning side to null (unless already changed)
  326.             if ($checklistNotification->getTask() === $this) {
  327.                 $checklistNotification->setTask(null);
  328.             }
  329.         }
  330.         return $this;
  331.     }
  332.     public function getDependantOn(): ?string
  333.     {
  334.         return $this->dependantOn;
  335.     }
  336.     public function setDependantOn(?string $dependantOn)
  337.     {
  338.         $this->dependantOn $dependantOn;
  339.         return $this;
  340.     }
  341.     public function getOffsetInDays(): ?int
  342.     {
  343.         return $this->offsetInDays;
  344.     }
  345.     public function setOffsetInDays(?int $offsetInDays): self
  346.     {
  347.         $this->offsetInDays $offsetInDays;
  348.         return $this;
  349.     }
  350.     public function getOffsetTask(): ?self
  351.     {
  352.         return $this->offsetTask;
  353.     }
  354.     public function setOffsetTask(?self $offsetTask): self
  355.     {
  356.         $this->offsetTask $offsetTask;
  357.         return $this;
  358.     }
  359.     /**
  360.      * @return Collection<int, self>
  361.      */
  362.     public function getOffsetTasks(): Collection
  363.     {
  364.         return $this->offsetTasks;
  365.     }
  366.     public function addOffsetTask(self $offsetTask): self
  367.     {
  368.         if (!$this->offsetTasks->contains($offsetTask)) {
  369.             $this->offsetTasks->add($offsetTask);
  370.             $offsetTask->setOffsetTask($this);
  371.         }
  372.         return $this;
  373.     }
  374.     public function removeOffsetTask(self $offsetTask): self
  375.     {
  376.         if ($this->offsetTasks->removeElement($offsetTask)) {
  377.             // set the owning side to null (unless already changed)
  378.             if ($offsetTask->getOffsetTask() === $this) {
  379.                 $offsetTask->setOffsetTask(null);
  380.             }
  381.         }
  382.         return $this;
  383.     }
  384.     public function getStartDate(): ?\DateTimeImmutable
  385.     {
  386.         return $this->startDate;
  387.     }
  388.     public function setStartDate(?\DateTimeImmutable $startDate): self
  389.     {
  390.         $this->startDate $startDate;
  391.         return $this;
  392.     }
  393.     public function getDurationInDays(): ?int
  394.     {
  395.         return $this->durationInDays;
  396.     }
  397.     public function setDurationInDays(?int $durationInDays): self
  398.     {
  399.         $this->durationInDays $durationInDays;
  400.         return $this;
  401.     }
  402.     /**
  403.      * @return Collection<int, ProjectDynamicField>
  404.      */
  405.     public function getProjectDynamicFields(): Collection
  406.     {
  407.         return $this->projectDynamicFields;
  408.     }
  409.     public function addProjectDynamicField(ProjectDynamicField $projectDynamicField): self
  410.     {
  411.         if (!$this->projectDynamicFields->contains($projectDynamicField)) {
  412.             $this->projectDynamicFields->add($projectDynamicField);
  413.             $projectDynamicField->setTask($this);
  414.         }
  415.         return $this;
  416.     }
  417.     public function removeProjectDynamicField(ProjectDynamicField $projectDynamicField): self
  418.     {
  419.         if ($this->projectDynamicFields->removeElement($projectDynamicField)) {
  420.             // set the owning side to null (unless already changed)
  421.             if ($projectDynamicField->getTask() === $this) {
  422.                 $projectDynamicField->setTask(null);
  423.             }
  424.         }
  425.         return $this;
  426.     }
  427. }