]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
[add] function to get tags by entry
authorNicolas Lœuillet <nicolas.loeuillet@gmail.com>
Fri, 6 Dec 2013 12:02:15 +0000 (13:02 +0100)
committerNicolas Lœuillet <nicolas.loeuillet@gmail.com>
Fri, 6 Dec 2013 12:02:15 +0000 (13:02 +0100)
inc/poche/Database.class.php

index c233eda16cf17df37ed5fb01831e950eca46ef80..86907e528fe2da66460bb3f36af2a82e68e44351 100644 (file)
@@ -249,4 +249,15 @@ class Database {
     public function getLastId($column = '') {
         return $this->getHandle()->lastInsertId($column);
     }
+
+    public function retrieveTagsByEntry($entry_id) {
+        $sql        = 
+            "SELECT * FROM tags
+            LEFT JOIN tags_entries ON tags_entries.tag_id=tags.id
+            WHERE tags_entries.entry_id = ?";
+        $query      = $this->executeQuery($sql, array($entry_id));
+        $tags    = $query->fetchAll();
+
+        return $tags;
+    }
 }