diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2016-04-06 23:43:27 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2016-04-06 23:43:43 +0200 |
commit | 65d28653ae1a1d2a7680ccfa694dbb7e2d4d750f (patch) | |
tree | 0e005dc5c41e7ba4c2dec602cea4d6e8aa2a4e65 /service/itemservice.php | |
parent | 4f8b81c7a353b5704d3a1d7d438077ac06dfdb4d (diff) |
try marking same items as read if they contain the same content
Diffstat (limited to 'service/itemservice.php')
-rw-r--r-- | service/itemservice.php | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/service/itemservice.php b/service/itemservice.php index 95a07d425..a571c15ac 100644 --- a/service/itemservice.php +++ b/service/itemservice.php @@ -148,14 +148,8 @@ class ItemService extends Service { * @throws ServiceNotFoundException if the item does not exist */ public function read($itemId, $isRead, $userId){ - $item = $this->find($itemId, $userId); - $item->setLastModified($this->timeFactory->getTime()); - if($isRead){ - $item->setRead(); - } else { - $item->setUnread(); - } - $this->itemMapper->update($item); + $lastModified = $this->timeFactory->getTime(); + $this->itemMapper->readItem($itemId, $isRead, $lastModified, $userId); } |