From 4dfafc5910baec90c9bc58aa61c1103dd41f13fe Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Fri, 20 Mar 2015 20:00:29 +0100 Subject: add a search parameter to the find all queries --- service/itemservice.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'service') diff --git a/service/itemservice.php b/service/itemservice.php index 900da3fb3..692eff916 100644 --- a/service/itemservice.php +++ b/service/itemservice.php @@ -80,24 +80,28 @@ class ItemService extends Service { * @param boolean $showAll if unread items should also be returned * @param boolean $oldestFirst if it should be ordered by oldest first * @param string $userId the name of the user + * @param string[] $search an array of keywords that the result should + * contain in either the author, title, link or body * @return array of items */ public function findAll($id, $type, $limit, $offset, $showAll, $oldestFirst, - $userId){ + $userId, $search=[]){ $status = $this->statusFlag->typeToStatus($type, $showAll); switch($type){ case FeedType::FEED: return $this->itemMapper->findAllFeed( - $id, $limit, $offset, $status, $oldestFirst, $userId + $id, $limit, $offset, $status, $oldestFirst, $userId, + $search ); case FeedType::FOLDER: return $this->itemMapper->findAllFolder( - $id, $limit, $offset, $status, $oldestFirst, $userId + $id, $limit, $offset, $status, $oldestFirst, $userId, + $search ); default: return $this->itemMapper->findAll( - $limit, $offset, $status, $oldestFirst, $userId + $limit, $offset, $status, $oldestFirst, $userId, $search ); } } -- cgit v1.2.3