diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/itemmapper.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/itemmapper.php b/lib/itemmapper.php index 9ecfa8fc6..40693071f 100644 --- a/lib/itemmapper.php +++ b/lib/itemmapper.php @@ -54,6 +54,26 @@ class ItemMapper { return $items; } + + /** + * @brief Retrieve all the items corresponding to a feed from the database with a particular status + * @param feedid The id of the feed in the database table. + * @param status one of the constants defined in OCA\News\StatusFlag + */ + public function findAllStatus($feedid, $status){ + $stmt = \OCP\DB::prepare('SELECT * FROM ' . self::tableName . ' + WHERE feed_id = ? + AND (status & ?)'); + $result = $stmt->execute(array($feedid, $status)); + + $items = array(); + while ($row = $result->fetchRow()) { + $item = $this->fromRow($row); + $items[] = $item; + } + + return $items; + } public function findIdFromGuid($guid, $feedid){ $stmt = \OCP\DB::prepare(' |