src/Entity/Task.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Base\AbstractTimestampableEntity;
  4. use App\Repository\TaskRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9.  * @ORM\Entity(repositoryClass=TaskRepository::class)
  10.  * @ORM\HasLifecycleCallbacks()
  11.  */
  12. class Task extends AbstractTimestampableEntity
  13. {
  14.     /**
  15.      * @ORM\Column(type="text", nullable=false)
  16.      */
  17.     private $name;
  18.     /**
  19.      * @ORM\Column(type="text", nullable=true)
  20.      */
  21.     private $technicalDescription;
  22.     /**
  23.      * @ORM\Column(type="integer")
  24.      */
  25.     private $scheduledHours;
  26.     /**
  27.      * @ORM\ManyToOne(targetEntity=User::class)
  28.      * @ORM\JoinColumn(nullable=false)
  29.      */
  30.     private $taskOwner;
  31.     /**
  32.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="assignedTasks")
  33.      */
  34.     private $assignedUser;
  35.     /**
  36.      * @ORM\Column(type="smallint")
  37.      */
  38.     private $priotity;
  39.     /**
  40.      * @ORM\ManyToOne(targetEntity=TaskStatus::class)
  41.      * @ORM\JoinColumn(nullable=false)
  42.      */
  43.     private $taskStatus;
  44.     /**
  45.      * @ORM\Column(type="datetime", nullable=true)
  46.      */
  47.     private $scheduleDate;
  48.     /**
  49.      * @ORM\OneToMany(targetEntity=TaskLog::class, mappedBy="task", orphanRemoval=true)
  50.      */
  51.     private $taskLogs;
  52.     /**
  53.      * @ORM\ManyToOne(targetEntity=Project::class, inversedBy="tasks")
  54.      * @ORM\JoinColumn(nullable=false)
  55.      */
  56.     private $project;
  57.     /**
  58.      * @ORM\Column(type="decimal", precision=11, scale=2, nullable=true)
  59.      */
  60.     private $offerValue;
  61.     /**
  62.      * @ORM\Column(type="decimal", precision=11, scale=2, nullable=true)
  63.      */
  64.     private $billableValue;
  65.     /**
  66.      * @ORM\ManyToOne(targetEntity=Currency::class, inversedBy="tasks")
  67.      * @ORM\JoinColumn(nullable=false)
  68.      */
  69.     private $currency;
  70.     /**
  71.      * @ORM\ManyToOne(targetEntity=TaskType::class, inversedBy="tasks")
  72.      * @ORM\JoinColumn(nullable=false)
  73.      */
  74.     private $taskType;
  75.     /**
  76.      * @ORM\OneToOne(targetEntity=OfferBody::class, cascade={"persist"})
  77.      */
  78.     private $offerBody;
  79.     /**
  80.      * @ORM\Column(type="integer", nullable=true)
  81.      */
  82.     private $workedMinutes;
  83.     /**
  84.      * @ORM\ManyToOne(targetEntity=Tranche::class, inversedBy="tasks")
  85.      */
  86.     private $tranche;
  87.     /**
  88.      * @ORM\Column(type="boolean", nullable=true)
  89.      */
  90.     private $notUsed;
  91.     /**
  92.      * @ORM\ManyToOne(targetEntity=Task::class, inversedBy="tasks")
  93.      */
  94.     private $notUsedParent;
  95.     /**
  96.      * @ORM\OneToMany(targetEntity=Task::class, mappedBy="notUsedParent")
  97.      */
  98.     private $tasks;
  99.     /**
  100.      * @ORM\Column(type="integer", nullable=true)
  101.      */
  102.     private $notUsedMinutes;
  103.     /**
  104.      * @ORM\Column(type="datetime", nullable=true)
  105.      */
  106.     private $finishedDate;
  107.     /**
  108.      * @ORM\Column(type="integer")
  109.      */
  110.     private $orderTask;
  111.     public function __construct()
  112.     {
  113.         $this->taskLogs = new ArrayCollection();
  114.         $this->tasks = new ArrayCollection();
  115.     }
  116.     public function getName(): ?string
  117.     {
  118.         return $this->name;
  119.     }
  120.     public function setName(string $name): self
  121.     {
  122.         $this->name $name;
  123.         return $this;
  124.     }
  125.     public function getTechnicalDescription(): ?string
  126.     {
  127.         return $this->technicalDescription;
  128.     }
  129.     public function setTechnicalDescription(?string $technicalDescription): self
  130.     {
  131.         $this->technicalDescription $technicalDescription;
  132.         return $this;
  133.     }
  134.     public function getScheduledHours(): ?int
  135.     {
  136.         return $this->scheduledHours;
  137.     }
  138.     public function setScheduledHours(int $scheduledHours): self
  139.     {
  140.         $this->scheduledHours $scheduledHours;
  141.         return $this;
  142.     }
  143.     public function getTaskOwner(): ?user
  144.     {
  145.         return $this->taskOwner;
  146.     }
  147.     public function setTaskOwner(?user $taskOwner): self
  148.     {
  149.         $this->taskOwner $taskOwner;
  150.         return $this;
  151.     }
  152.     public function getAssignedUser(): ?user
  153.     {
  154.         return $this->assignedUser;
  155.     }
  156.     public function setAssignedUser(?user $assignedUser): self
  157.     {
  158.         $this->assignedUser $assignedUser;
  159.         return $this;
  160.     }
  161.     public function getPriotity(): ?int
  162.     {
  163.         return $this->priotity;
  164.     }
  165.     public function setPriotity(int $priotity): self
  166.     {
  167.         $this->priotity $priotity;
  168.         return $this;
  169.     }
  170.     public function getTaskStatus()
  171.     {
  172.         return $this->taskStatus;
  173.     }
  174.     public function setTaskStatus($taskStatus): void
  175.     {
  176.         $this->taskStatus $taskStatus;
  177.     }
  178.     public function getScheduleDate(): ?\DateTimeInterface
  179.     {
  180.         return $this->scheduleDate;
  181.     }
  182.     public function setScheduleDate(?\DateTimeInterface $scheduleDate): self
  183.     {
  184.         $this->scheduleDate $scheduleDate;
  185.         return $this;
  186.     }
  187.     /**
  188.      * @return Collection<int, TaskLog>
  189.      */
  190.     public function getTaskLogs(): Collection
  191.     {
  192.         return $this->taskLogs;
  193.     }
  194.     public function addTaskLog(TaskLog $taskLog): self
  195.     {
  196.         if (!$this->taskLogs->contains($taskLog)) {
  197.             $this->taskLogs[] = $taskLog;
  198.             $taskLog->setTask($this);
  199.         }
  200.         return $this;
  201.     }
  202.     public function removeTaskLog(TaskLog $taskLog): self
  203.     {
  204.         if ($this->taskLogs->removeElement($taskLog)) {
  205.             // set the owning side to null (unless already changed)
  206.             if ($taskLog->getTask() === $this) {
  207.                 $taskLog->setTask(null);
  208.             }
  209.         }
  210.         return $this;
  211.     }
  212.     public function getProject(): ?Project
  213.     {
  214.         return $this->project;
  215.     }
  216.     public function setProject(?Project $project): self
  217.     {
  218.         $this->project $project;
  219.         return $this;
  220.     }
  221.     public function getOfferValue(): ?string
  222.     {
  223.         return $this->offerValue;
  224.     }
  225.     public function setOfferValue(?string $offerValue): self
  226.     {
  227.         $this->offerValue $offerValue;
  228.         return $this;
  229.     }
  230.     public function getBillableValue(): ?string
  231.     {
  232.         return $this->billableValue;
  233.     }
  234.     public function setBillableValue(?string $billableValue): self
  235.     {
  236.         $this->billableValue $billableValue;
  237.         return $this;
  238.     }
  239.     public function getCurrency(): ?Currency
  240.     {
  241.         return $this->currency;
  242.     }
  243.     public function setCurrency(?Currency $currency): self
  244.     {
  245.         $this->currency $currency;
  246.         return $this;
  247.     }
  248.     public function getTaskType(): ?TaskType
  249.     {
  250.         return $this->taskType;
  251.     }
  252.     public function setTaskType(?TaskType $taskType): self
  253.     {
  254.         $this->taskType $taskType;
  255.         return $this;
  256.     }
  257.     public function getOfferBody(): ?OfferBody
  258.     {
  259.         return $this->offerBody;
  260.     }
  261.     public function setOfferBody(?OfferBody $offerBody): self
  262.     {
  263.         $this->offerBody $offerBody;
  264.         return $this;
  265.     }
  266.     public function getWorkedMinutes(): ?int
  267.     {
  268.         return $this->workedMinutes;
  269.     }
  270.     public function setWorkedMinutes(?int $workedMinutes): self
  271.     {
  272.         $this->workedMinutes $workedMinutes;
  273.         return $this;
  274.     }
  275.     public function getTranche(): ?Tranche
  276.     {
  277.         return $this->tranche;
  278.     }
  279.     public function setTranche(?Tranche $tranche): self
  280.     {
  281.         $this->tranche $tranche;
  282.         return $this;
  283.     }
  284.     public function isNotUsed(): ?bool
  285.     {
  286.         return $this->notUsed;
  287.     }
  288.     public function setNotUsed(?bool $notUsed): self
  289.     {
  290.         $this->notUsed $notUsed;
  291.         return $this;
  292.     }
  293.     public function getNotUsedParent(): ?self
  294.     {
  295.         return $this->notUsedParent;
  296.     }
  297.     public function setNotUsedParent(?self $notUsedParent): self
  298.     {
  299.         $this->notUsedParent $notUsedParent;
  300.         return $this;
  301.     }
  302.     /**
  303.      * @return Collection<int, self>
  304.      */
  305.     public function getTasks(): Collection
  306.     {
  307.         return $this->tasks;
  308.     }
  309.     public function addTask(self $task): self
  310.     {
  311.         if (!$this->tasks->contains($task)) {
  312.             $this->tasks[] = $task;
  313.             $task->setNotUsedParent($this);
  314.         }
  315.         return $this;
  316.     }
  317.     public function removeTask(self $task): self
  318.     {
  319.         if ($this->tasks->removeElement($task)) {
  320.             // set the owning side to null (unless already changed)
  321.             if ($task->getNotUsedParent() === $this) {
  322.                 $task->setNotUsedParent(null);
  323.             }
  324.         }
  325.         return $this;
  326.     }
  327.     public function getNotUsedMinutes(): ?int
  328.     {
  329.         return $this->notUsedMinutes;
  330.     }
  331.     public function setNotUsedMinutes(?int $notUsedMinutes): self
  332.     {
  333.         $this->notUsedMinutes $notUsedMinutes;
  334.         return $this;
  335.     }
  336.     public function getFinishedDate(): ?\DateTimeInterface
  337.     {
  338.         return $this->finishedDate;
  339.     }
  340.     public function setFinishedDate(?\DateTimeInterface $finishedDate): self
  341.     {
  342.         $this->finishedDate $finishedDate;
  343.         return $this;
  344.     }
  345.     public function getOrderTask(): ?int
  346.     {
  347.         return $this->orderTask;
  348.     }
  349.     public function setOrderTask(int $orderTask): self
  350.     {
  351.         $this->orderTask $orderTask;
  352.         return $this;
  353.     }
  354. }