]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
reformat and CS
authorcweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>
Sat, 20 Feb 2010 11:12:51 +0000 (11:12 +0000)
committercweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>
Sat, 20 Feb 2010 11:12:51 +0000 (11:12 +0000)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@666 b3834d28-1941-0410-a4f8-b48e95affb8f

src/SemanticScuttle/Service/Bookmark2Tag.php

index 8e5cb22c38529a86f15424b6b7a51c1cb804ac20..e0f831e807806fd2ad3ee6d5d8398f374d5c1020 100644 (file)
@@ -266,21 +266,39 @@ class SemanticScuttle_Service_Bookmark2Tag extends SemanticScuttle_DbService
         return true;
     }
 
-    function &getTagsForBookmark($bookmarkid) {
+
+    /**
+     * Retrieves all tags for a given bookmark except system tags.
+     *
+     * @param integer $bookmarkid ID of the bookmark
+     *
+     * @return array Array of tags
+     */
+    public function getTagsForBookmark($bookmarkid)
+    {
         if (!is_numeric($bookmarkid)) {
-            message_die(GENERAL_ERROR, 'Could not get tags (invalid bookmarkid)', '', __LINE__, __FILE__, $query);
+            message_die(
+                GENERAL_ERROR, 'Could not get tags (invalid bookmarkid)',
+                '', __LINE__, __FILE__, $query
+            );
             return false;
         }
 
-        $query = 'SELECT tag FROM '. $this->getTableName() .' WHERE bId = '. intval($bookmarkid) .' AND LEFT(tag, 7) <> "system:" ORDER BY id ASC';
+        $query = 'SELECT tag FROM ' . $this->getTableName()
+            . ' WHERE bId = ' . intval($bookmarkid)
+            . ' AND LEFT(tag, 7) <> "system:"'
+            . ' ORDER BY id ASC';
 
-        if (!($dbresult =& $this->db->sql_query($query))) {
-            message_die(GENERAL_ERROR, 'Could not get tags', '', __LINE__, __FILE__, $query, $this->db);
+        if (!($dbresult = $this->db->sql_query($query))) {
+            message_die(
+                GENERAL_ERROR, 'Could not get tags',
+                '', __LINE__, __FILE__, $query, $this->db
+            );
             return false;
         }
 
         $tags = array();
-        while ($row =& $this->db->sql_fetchrow($dbresult)) {
+        while ($row = $this->db->sql_fetchrow($dbresult)) {
             $tags[] = $row['tag'];
         }
         $this->db->sql_freeresult($dbresult);