1 | <?php |
||
12 | class Notes |
||
13 | { |
||
14 | const URL_NOTES = '/api/note'; |
||
15 | /** |
||
16 | * @var Transport |
||
17 | */ |
||
18 | private $transport; |
||
19 | |||
20 | /** |
||
21 | * @var NoteCollection |
||
22 | */ |
||
23 | private $notes; |
||
24 | |||
25 | public function __construct(Transport $transport) |
||
30 | |||
31 | public function getAll() |
||
39 | |||
40 | /** |
||
41 | * Fetch most recent data to cache |
||
42 | * @throws NotAuthenticated |
||
43 | * @throws \HttpException |
||
44 | */ |
||
45 | private function fetch() |
||
61 | |||
62 | /** |
||
63 | * @param NoteId $id |
||
64 | * @return Note|null |
||
65 | */ |
||
66 | public function getOne(NoteId $id) |
||
70 | |||
71 | /** |
||
72 | * Update existing note |
||
73 | * @param Note $note |
||
74 | * @return void |
||
75 | * @throws \HttpException |
||
76 | */ |
||
77 | public function update(Note $note) |
||
90 | |||
91 | /** |
||
92 | * Insert a new note to the system |
||
93 | * @param Note $note |
||
94 | * @return NoteId |
||
95 | * @throws \HttpException |
||
96 | */ |
||
97 | public function insert(Note $note) |
||
112 | } |