diff --git a/src/Entity/TaskEntity.php b/src/Entity/TaskEntity.php index 3e852b6..af86926 100644 --- a/src/Entity/TaskEntity.php +++ b/src/Entity/TaskEntity.php @@ -32,6 +32,9 @@ /** @var DateTime|NULL The date when the task were done */ protected $executionDate = null; + /** @var ActorEntity|NULL The actor of the task */ + protected $actor = null; + /** @var ActivityEntity|NULL The related activity if it is in the context of an activity */ protected $activity = null; @@ -145,6 +148,29 @@ return $this; } + + /** + * Get the related actor + * + * @return ActorEntity|NULL + */ + public function getActor(): ?ActorEntity + { + return $this->actor; + } + + /** + * Set the new related actor + * + * @param ActorEntity|NULL $actor + * @return self + */ + public function setActor(?ActorEntity $actor): self + { + $this->actor = $actor; + + return $this; + } /** * Get the related activity @@ -168,4 +194,32 @@ return $this; } + + /** + * Get the status of the activity + * + * @return string + * @see StatusEnum + */ + public function getStatus(): string + { + return $this->status; + } + + /** + * Set a new status for the activity + * + * @param string $status + * @return self + * @see StatusEnum + */ + public function setStatus(string $status): self + { + if (!in_array($status, $this::VALID_STATUS)) { + throw new InvalidEnumKeyException(); + } + $this->status = $status; + + return $this; + } } \ No newline at end of file