aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/poche/Database.class.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/poche/Database.class.php')
-rw-r--r--inc/poche/Database.class.php16
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 {