1: <?php
2:
3: namespace Crowdsdom\Labor\Models;
4:
5: class Task extends Base\Task
6: {
7: const ENDPOINT = '/Tasks';
8:
9: public function create(array $data)
10: {
11: throw new \BadMethodCallException;
12: }
13:
14: public function find()
15: {
16: throw new \BadMethodCallException;
17: }
18:
19: public function findById($id)
20: {
21: throw new \BadMethodCallException;
22: }
23:
24: public function approve($id)
25: {
26: $response = $this->client->getGuzzle()->request('POST', static::ENDPOINT . "/{$id}/approve", []);
27: return json_decode($response->getBody()->getContents(), true);
28: }
29:
30: public function reject($id)
31: {
32: $response = $this->client->getGuzzle()->request('POST', static::ENDPOINT . "/{$id}/reject", []);
33: return json_decode($response->getBody()->getContents(), true);
34: }
35: }
36: