1
0
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:
Nicolas Lœuillet 2014-01-09 21:08:00 +01:00
parent 99c6d290c6
commit 839b6ea2c4
2 changed files with 5 additions and 5 deletions

View File

@ -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) {

View File

@ -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();
}