1 | <?php |
||
35 | class NoteService { |
||
36 | |||
37 | private $noteMapper; |
||
38 | private $utils; |
||
39 | private $sharing; |
||
40 | private $groupService; |
||
41 | |||
42 | public function __construct(NoteMapper $noteMapper, Utils $utils, NextNoteShareBackend $shareBackend, NotebookService $groupService) { |
||
48 | |||
49 | /** |
||
50 | * Get notes from a user. |
||
51 | * |
||
52 | * @param $userId |
||
53 | * @param int|bool $deleted |
||
54 | * @param string|bool $grouping |
||
55 | * @return Note[] |
||
56 | */ |
||
57 | public function findNotesFromUser($userId, $deleted = false, $grouping = false) { |
||
65 | |||
66 | /** |
||
67 | * Get a single note |
||
68 | * |
||
69 | * @param $note_id |
||
70 | * @param $user_id |
||
71 | * @param bool|int $deleted |
||
72 | * @return Note |
||
73 | * @internal param $vault_id |
||
74 | */ |
||
75 | public function find($note_id, $user_id = null, $deleted = false) { |
||
79 | |||
80 | /** |
||
81 | * Creates a note |
||
82 | * |
||
83 | * @param Note $note |
||
84 | * @return Note |
||
85 | * @throws \Exception |
||
86 | */ |
||
87 | public function create(Note $note) { |
||
94 | |||
95 | /** |
||
96 | * Update note |
||
97 | * |
||
98 | * @param $note Note |
||
99 | * @return Note|bool |
||
100 | * @throws \Exception |
||
101 | * @internal param $userId |
||
102 | * @internal param $vault |
||
103 | */ |
||
104 | public function update(Note $note) { |
||
111 | |||
112 | /** |
||
113 | * Delete a note from user |
||
114 | * |
||
115 | * @param $note_id |
||
116 | * @param string $user_id |
||
117 | * @return bool |
||
118 | * @internal param string $vault_guid |
||
119 | */ |
||
120 | public function delete($note_id, $user_id = null) { |
||
129 | |||
130 | /** |
||
131 | * Creates an example note for a user. |
||
132 | * @param $userId |
||
133 | */ |
||
134 | public function createExampleNote($userId) { |
||
143 | } |
||
144 |