| @@ 51-65 (lines=15) @@ | ||
| 48 | * @param int|bool $deleted |
|
| 49 | * @return Notebook[] |
|
| 50 | */ |
|
| 51 | public function findNotebooksFromUser($userId, $deleted = false) { |
|
| 52 | // Get shares |
|
| 53 | $dbNotebooks = $this->notebookMapper->find(null, $userId, $deleted); |
|
| 54 | $n = $dbNotebooks; |
|
| 55 | if($dbNotebooks instanceof Notebook){ |
|
| 56 | $dbNotebooks = []; |
|
| 57 | /** |
|
| 58 | * @var $result Notebook |
|
| 59 | */ |
|
| 60 | $dbNotebooks[$n->getId()] = $n; |
|
| 61 | } |
|
| 62 | $sharedNotebooks = []; |
|
| 63 | $notebooks = array_merge($dbNotebooks, $sharedNotebooks); |
|
| 64 | return $notebooks; |
|
| 65 | } |
|
| 66 | ||
| 67 | ||
| 68 | /** |
|
| @@ 53-71 (lines=19) @@ | ||
| 50 | * @param string|bool $grouping |
|
| 51 | * @return Note[] |
|
| 52 | */ |
|
| 53 | public function findNotesFromUser($userId, $deleted = false, $grouping = false) { |
|
| 54 | // Get shares |
|
| 55 | ||
| 56 | $dbNotes = $this->noteMapper->findNotesFromUser($userId, $deleted, $grouping); |
|
| 57 | ||
| 58 | $n = $dbNotes; |
|
| 59 | if($dbNotes instanceof Note){ |
|
| 60 | $dbNotes = []; |
|
| 61 | /** |
|
| 62 | * @var $n Note |
|
| 63 | */ |
|
| 64 | $dbNotes[$n->getId()] = $n; |
|
| 65 | } |
|
| 66 | ||
| 67 | //$sharedNotes = $this->sharing->getSharedNotes(); |
|
| 68 | $sharedNotes = []; |
|
| 69 | $notes = array_merge($dbNotes, $sharedNotes); |
|
| 70 | return $notes; |
|
| 71 | } |
|
| 72 | ||
| 73 | /** |
|
| 74 | * Get a single note |
|