From 90cd3cc4e751fd2842b1094ebc9a54a7ce5ed325 Mon Sep 17 00:00:00 2001 From: Chris Birk Date: Tue, 16 Jun 2015 16:05:48 -0400 Subject: [PATCH 1/3] add Tasklist::createTask() --- src/Rossedman/Teamwork/Tasklist.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Rossedman/Teamwork/Tasklist.php b/src/Rossedman/Teamwork/Tasklist.php index f44091a..6f23705 100644 --- a/src/Rossedman/Teamwork/Tasklist.php +++ b/src/Rossedman/Teamwork/Tasklist.php @@ -55,4 +55,13 @@ public function timeTotal() return $this->client->get("tasklists/$this->id/time/total")->response(); } + /** + * Create task in tasklist + * POST /tasklists/{id}/tasks.json + * + */ + public function createTask($args) + { + return $this->client->post("$this->endpoint/$this->id/tasks", ['todo-item' => $args])->response(); + } } From 2122004033831b94861e57dfd3f44573ceafeee6 Mon Sep 17 00:00:00 2001 From: Chris Birk Date: Tue, 16 Jun 2015 16:09:41 -0400 Subject: [PATCH 2/3] add @return phpdoc statement to Tasklist::createTask() --- src/Rossedman/Teamwork/Tasklist.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Rossedman/Teamwork/Tasklist.php b/src/Rossedman/Teamwork/Tasklist.php index 6f23705..3bdbd50 100644 --- a/src/Rossedman/Teamwork/Tasklist.php +++ b/src/Rossedman/Teamwork/Tasklist.php @@ -59,6 +59,7 @@ public function timeTotal() * Create task in tasklist * POST /tasklists/{id}/tasks.json * + * @return mixed */ public function createTask($args) { From 606302bf55fe0df1ee68be7adcbc36c943d9d20a Mon Sep 17 00:00:00 2001 From: Chris Birk Date: Tue, 16 Jun 2015 16:25:55 -0400 Subject: [PATCH 3/3] add Tasklist::tasks() --- src/Rossedman/Teamwork/Tasklist.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Rossedman/Teamwork/Tasklist.php b/src/Rossedman/Teamwork/Tasklist.php index 3bdbd50..01ae0f5 100644 --- a/src/Rossedman/Teamwork/Tasklist.php +++ b/src/Rossedman/Teamwork/Tasklist.php @@ -55,6 +55,18 @@ public function timeTotal() return $this->client->get("tasklists/$this->id/time/total")->response(); } + /** + * All tasks on task list + * + * GET /tasklists/{id}/tasks.json + * + * @return mixed + */ + public function tasks($args = null) + { + return $this->client->get("$this->endpoint/$this->id/tasks")->response($args); + } + /** * Create task in tasklist * POST /tasklists/{id}/tasks.json