diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2014-02-18 15:29:40 +0100 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2014-02-18 15:29:40 +0100 |
commit | 970cfb11661e20027ef4c6b3912dfe2dbafb8c0b (patch) | |
tree | f84989877616550814e9e46a5316f6e95126951a /inc/poche/Database.class.php | |
parent | 6285e57c49bd06ed52ab997f0dc767576b7da126 (diff) | |
parent | 488fc63b67312640dcac68a324794ec4a591ba6d (diff) | |
download | wallabag-970cfb11661e20027ef4c6b3912dfe2dbafb8c0b.tar.gz wallabag-970cfb11661e20027ef4c6b3912dfe2dbafb8c0b.tar.zst wallabag-970cfb11661e20027ef4c6b3912dfe2dbafb8c0b.zip |
Merge pull request #460 from mariroz/dev
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 | { |