/** * {@inheritdoc} */ public function logWork($timeSpent, \DateTime $dateStarted, Task $task, User $user, $description = null) { $timeSpent = $this->timeSpentFactory->createFromString($timeSpent); $worklog = $this->worklogFactory->create($timeSpent, $dateStarted, $task, $user, $description); $this->worklogRepository->save($worklog); return $worklog->getId(); }
/** * @param Tracker $tracker */ private function processStopTracking(Tracker $tracker) { $this->trackerRepository->removeTracker($tracker); $timeSpent = $this->timeSpentFactory->create($tracker->getSpentSeconds()); $worklog = $this->worklogFactory->create($timeSpent, $tracker->getDateStarted(), $tracker->getTask(), $tracker->getUser()); $this->worklogRepository->save($worklog); }