diff options
author | Maryana Rozhankivska <mariroz@mr.lviv.ua> | 2014-02-14 17:27:22 +0200 |
---|---|---|
committer | Maryana Rozhankivska <mariroz@mr.lviv.ua> | 2014-02-14 17:27:22 +0200 |
commit | 488fc63b67312640dcac68a324794ec4a591ba6d (patch) | |
tree | f84989877616550814e9e46a5316f6e95126951a /inc/poche/Database.class.php | |
parent | 6285e57c49bd06ed52ab997f0dc767576b7da126 (diff) | |
download | wallabag-488fc63b67312640dcac68a324794ec4a591ba6d.tar.gz wallabag-488fc63b67312640dcac68a324794ec4a591ba6d.tar.zst wallabag-488fc63b67312640dcac68a324794ec4a591ba6d.zip |
duplicate check added. fix of issue #400
Diffstat (limited to 'inc/poche/Database.class.php')
-rw-r--r-- | inc/poche/Database.class.php | 16 |
1 files changed, 16 insertions, 0 deletions
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 { | |||
241 | return isset($entry[0]) ? $entry[0] : null; | 241 | return isset($entry[0]) ? $entry[0] : null; |
242 | } | 242 | } |
243 | 243 | ||
244 | public function retrieveOneByURL($url, $user_id) { | ||
245 | $entry = NULL; | ||
246 | $sql = "SELECT * FROM entries WHERE url=? AND user_id=?"; | ||
247 | $params = array($url, $user_id); | ||
248 | $query = $this->executeQuery($sql, $params); | ||
249 | $entry = $query->fetchAll(); | ||
250 | |||
251 | return isset($entry[0]) ? $entry[0] : null; | ||
252 | } | ||
253 | |||
254 | public function reassignTags($old_entry_id, $new_entry_id) { | ||
255 | $sql = "UPDATE tags_entries SET entry_id=? WHERE entry_id=?"; | ||
256 | $params = array($new_entry_id, $old_entry_id); | ||
257 | $query = $this->executeQuery($sql, $params); | ||
258 | } | ||
259 | |||
244 | public function getEntriesByView($view, $user_id, $limit = '') { | 260 | public function getEntriesByView($view, $user_id, $limit = '') { |
245 | switch ($_SESSION['sort']) | 261 | switch ($_SESSION['sort']) |
246 | { | 262 | { |