diff --git a/src/Entity/TaskEntity.php b/src/Entity/TaskEntity.php new file mode 100644 index 0000000..3e852b6 --- /dev/null +++ b/src/Entity/TaskEntity.php @@ -0,0 +1,171 @@ +id; + } + + /** + * Set the ID of the entity + *
This should not be done after creation + * + * @param string $id + * @return self + */ + public function setId(string $id): self + { + $this->id = $id; + + return $this; + } + + /** + * Generate and save a random ID + * + * @return string Generated ID + */ + public function generateId(): string + { + // Generate ID + $id = StringGenerationHelper::generateString(array_merge(range('a', 'z'), range('A', 'Z'), range('0', '9')), 8); + + // Save and return + $this->setId($id); + return $id; + } + + /** + * Get the task name + * + * @return string + */ + public function getName(): string + { + return $this->name; + } + + /** + * Set a new name for the task + * + * @param string $name + * @return self + */ + public function setName(string $name): self + { + $this->name = $name; + + return $this; + } + + /** + * Get the planified execution date + * + * @return DateTime|NULL + */ + public function getPlanifiedDate(): ?DateTime + { + return $this->planifiedDate; + } + + /** + * Set the planified execution date + * + * @param DateTime $planifiedDate + * @return self + */ + public function setPlanifiedDate(?DateTime $planifiedDate): self + { + $this->planifiedDate = $planifiedDate; + + return $this; + } + + /** + * Get the effective execution date + * + * @return DateTime|NULL + */ + public function getExecutionDate(): ?DateTime + { + return $this->planifiedDate; + } + + /** + * Set the effective execution date + * + * @param DateTime $executionDate + * @return self + */ + public function setExecutionDate(?DateTime $executionDate): self + { + $this->executionDate = $executionDate; + + return $this; + } + + /** + * Get the related activity + * + * @return ActivityEntity|NULL + */ + public function getActivity(): ?ActivityEntity + { + return $this->activity; + } + + /** + * Set the related activity + * + * @param ActivityEntity $activity + * @return self + */ + public function setActivity(?ActivityEntity $activity): self + { + $this->activity = $activity; + + return $this; + } +} \ No newline at end of file