From 488fc63b67312640dcac68a324794ec4a591ba6d Mon Sep 17 00:00:00 2001 From: Maryana Rozhankivska Date: Fri, 14 Feb 2014 17:27:22 +0200 Subject: duplicate check added. fix of issue #400 --- inc/poche/Database.class.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'inc/poche/Database.class.php') diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php index 9f553fa1..58583bf5 100644 --- a/inc/poche/Database.class.php +++ b/inc/poche/Database.class.php @@ -241,6 +241,22 @@ class Database { return isset($entry[0]) ? $entry[0] : null; } + public function retrieveOneByURL($url, $user_id) { + $entry = NULL; + $sql = "SELECT * FROM entries WHERE url=? AND user_id=?"; + $params = array($url, $user_id); + $query = $this->executeQuery($sql, $params); + $entry = $query->fetchAll(); + + return isset($entry[0]) ? $entry[0] : null; + } + + public function reassignTags($old_entry_id, $new_entry_id) { + $sql = "UPDATE tags_entries SET entry_id=? WHERE entry_id=?"; + $params = array($new_entry_id, $old_entry_id); + $query = $this->executeQuery($sql, $params); + } + public function getEntriesByView($view, $user_id, $limit = '') { switch ($_SESSION['sort']) { -- cgit v1.2.3