mirror of
https://github.com/moparisthebest/wallabag
synced 2024-11-15 13:45:04 -05:00
[add] method code for get bookmarks
This commit is contained in:
parent
024e003943
commit
9d0b1712be
@ -15,6 +15,10 @@ class EntryApi
|
||||
return $this->entryRepository->getEntries($status);
|
||||
}
|
||||
|
||||
public function getBookmarks() {
|
||||
return $this->entryRepository->getBookmarks();
|
||||
}
|
||||
|
||||
public function getEntryById($id) {
|
||||
return $this->entryRepository->getEntryById($id);
|
||||
}
|
||||
|
@ -18,6 +18,14 @@ class EntryRepository
|
||||
return $entries ? $entries : array();
|
||||
}
|
||||
|
||||
//TODO don't hardcode the user ;)
|
||||
public function getBookmarks($userId = 1) {
|
||||
$sql = "SELECT * FROM entries where user_id = ? AND bookmark = 1 ORDER BY id DESC";
|
||||
$entries = $this->db->fetchAll($sql, array($userId));
|
||||
|
||||
return $entries ? $entries : array();
|
||||
}
|
||||
|
||||
//TODO don't hardcode the user ;)
|
||||
public function saveEntry($entry, $userId = 1) {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user