taskwarrior = new Taskwarrior(); } else { $this->taskwarrior = $taskwarrior; } // Initialize strategies $this->todoStrategy = new TodoStrategy($this->taskwarrior->getConfig()); } public function addTask(VTodo $document){ $this->taskwarrior->setStrategy($this->todoStrategy); $task = $this->taskwarrior->createTask((string)$document->UID); $task->setDescription($document); $task->setEntryTime($document); $task->setDue($document); $task->setCategories($document); $task->setStatus($document); $task->setRecurrence($document); return $this->taskwarrior->add($task); } public function updateTask(VTodo $document){ $task = $this->taskwarrior->get($document->UID); $task->setDescription($document); $task->setEntry($document); $task->setStartTime($document); $task->setModifiedTime($document); $task->setStopTime($document); $task->setDue($document); $task->setCategories($document); $task->setStatus($document); $task->setRecurrence($document); $updatedTask = $this->taskwarrior->modify($task); return $upatedTask; } public function taskExists($taskUuid){ $this->taskwarrior->setStrategy($this->$todoStrategy); return $this->taskwarrior->count((string)$taskUuid); } } ?>