summaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/itemmapper.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/db/itemmapper.php b/db/itemmapper.php
index 0d9469c9d..8f200c39e 100644
--- a/db/itemmapper.php
+++ b/db/itemmapper.php
@@ -67,8 +67,8 @@ class ItemMapper extends Mapper implements IMapper {
public function find($id, $userId){
- $sql = $this->makeSelectQuery('WHERE `*PREFIX*news_items`.`id` = ? ');
- $row = $this->findOneQuery($sql, array($id, $userId));
+ $sql = $this->makeSelectQuery('AND `*PREFIX*news_items`.`id` = ? ');
+ $row = $this->findOneQuery($sql, array($userId, $id));
$item = new Item();
$item->fromRow($row);
@@ -168,4 +168,16 @@ class ItemMapper extends Mapper implements IMapper {
return $this->findAllRows($sql, $params, $limit);
}
+
+ public function findByGuidHash($guidHash, $userId){
+ $sql = $this->makeSelectQuery('AND `*PREFIX*news_items`.`guid_hash` = ? ');
+ $row = $this->findOneQuery($sql, array($userId, $guidHash));
+
+ $item = new Item();
+ $item->fromRow($row);
+
+ return $item;
+ }
+
+
}