1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Guillermoandrae\Highrise\Resources; |
4
|
|
|
|
5
|
|
|
use Guillermoandrae\Common\CollectionInterface; |
6
|
|
|
|
7
|
|
|
class Tasks extends AbstractRelationalResource |
8
|
|
|
{ |
9
|
|
|
use UnsearchableResourceTrait; |
10
|
|
|
|
11
|
1 |
|
public function findAll(array $filters = []): CollectionInterface |
12
|
|
|
{ |
13
|
1 |
|
$uri = sprintf('/%s/all.xml', $this->getName()); |
14
|
1 |
|
return $this->getAdapter()->request('GET', $uri); |
15
|
|
|
} |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* Returns all upcoming tasks assigned to the authenticated user. |
19
|
|
|
* |
20
|
|
|
* @return CollectionInterface |
21
|
|
|
*/ |
22
|
1 |
|
public function findUpcoming(): CollectionInterface |
23
|
|
|
{ |
24
|
1 |
|
$uri = sprintf('/%s/upcoming.xml', $this->getName()); |
25
|
1 |
|
return $this->getAdapter()->request('GET', $uri); |
26
|
|
|
} |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* Returns all assigned tasks assigned to the authenticated user. |
30
|
|
|
* |
31
|
|
|
* @return CollectionInterface |
32
|
|
|
*/ |
33
|
1 |
|
public function findAssigned(): CollectionInterface |
34
|
|
|
{ |
35
|
1 |
|
$uri = sprintf('/%s/assigned.xml', $this->getName()); |
36
|
1 |
|
return $this->getAdapter()->request('GET', $uri); |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* Returns all completed tasks assigned to the authenticated user. |
41
|
|
|
* |
42
|
|
|
* @return CollectionInterface |
43
|
|
|
*/ |
44
|
1 |
|
public function findCompleted(): CollectionInterface |
45
|
|
|
{ |
46
|
1 |
|
$uri = sprintf('/%s/completed.xml', $this->getName()); |
47
|
1 |
|
return $this->getAdapter()->request('GET', $uri); |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* Returns all of today's tasks assigned to the authenticated user. |
52
|
|
|
* |
53
|
|
|
* @return CollectionInterface |
54
|
|
|
*/ |
55
|
1 |
|
public function findToday(): CollectionInterface |
56
|
|
|
{ |
57
|
1 |
|
$uri = sprintf('/%s/today.xml', $this->getName()); |
58
|
1 |
|
return $this->getAdapter()->request('GET', $uri); |
59
|
|
|
} |
60
|
|
|
} |
61
|
|
|
|