Skip to content

Commit

Permalink
Added methods for time-entries
Browse files Browse the repository at this point in the history
find() - single time entry
edit()
delete()
  • Loading branch information
Mat-Gr committed Sep 13, 2017
1 parent 832cbb8 commit 6bb2f5f
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion src/Rossedman/Teamwork/Time.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,39 @@ public function all($args = null)

return $this->client->get($this->endpoint, $args)->response();
}
}

/**
* GET /time_entries/id.json
*
* @return mixed
*/
public function find($args = null)
{
$this->areArgumentsValid($args, ['page']);

return $this->client->get("$this->endpoint/$this->id.json", $args)->response();
}

/**
* Edit A Time entry
* PUT /time_entries/{id}.json
*
* @return mixed
*/
public function edit($data)
{
return $this->client->put("$this->endpoint/$this->id.json", ['time-entry' => $data])->response();
}

/**
* Delete A Time entry
* DELETE /time_entries/{id}.json
*
* @return mixed
*/
public function delete()
{
return $this->client->delete("$this->endpoint/$this->id.json")->response();
}

}

0 comments on commit 6bb2f5f

Please sign in to comment.