mirror of
https://github.com/moparisthebest/wallabag
synced 2025-02-22 13:51:47 -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);
|
return $this->entryRepository->getEntries($status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getBookmarks() {
|
||||||
|
return $this->entryRepository->getBookmarks();
|
||||||
|
}
|
||||||
|
|
||||||
public function getEntryById($id) {
|
public function getEntryById($id) {
|
||||||
return $this->entryRepository->getEntryById($id);
|
return $this->entryRepository->getEntryById($id);
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,14 @@ class EntryRepository
|
|||||||
return $entries ? $entries : array();
|
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 ;)
|
//TODO don't hardcode the user ;)
|
||||||
public function saveEntry($entry, $userId = 1) {
|
public function saveEntry($entry, $userId = 1) {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user