mirror of
https://github.com/moparisthebest/wallabag
synced 2024-12-18 05:32:23 -05:00
[add] api code for archive entries
This commit is contained in:
parent
99c6d290c6
commit
839b6ea2c4
@ -11,8 +11,8 @@ class EntryApi
|
||||
$this->contentApi = $contentApi;
|
||||
}
|
||||
|
||||
public function getEntries() {
|
||||
return $this->entryRepository->getEntries();
|
||||
public function getEntries($status) {
|
||||
return $this->entryRepository->getEntries($status);
|
||||
}
|
||||
|
||||
public function getEntryById($id) {
|
||||
|
@ -11,9 +11,9 @@ class EntryRepository
|
||||
}
|
||||
|
||||
//TODO don't hardcode the user ;)
|
||||
public function getEntries($userId = 1) {
|
||||
$sql = "SELECT * FROM entries where user_id = ? AND status = 'unread' ORDER BY id DESC";
|
||||
$entries = $this->db->fetchAll($sql, array($userId));
|
||||
public function getEntries($status, $userId = 1) {
|
||||
$sql = "SELECT * FROM entries where user_id = ? AND status = ? ORDER BY id DESC";
|
||||
$entries = $this->db->fetchAll($sql, array($userId, $status));
|
||||
|
||||
return $entries ? $entries : array();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user