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

src/SemanticScuttle/Service/User.php

index 0b28663f2099ef142d9c478b9dd071a8b88fb6af..7b03dd2d6cee9ff0207e3e073051f72e8cf0026f 100644 (file)
@@ -76,15 +76,28 @@ class SemanticScuttle_Service_User extends SemanticScuttle_DbService
         $this->updateSessionStability();
     }
 
-    function _getuser($fieldname, $value) {
-        $query = 'SELECT * FROM '. $this->getTableName() .' WHERE '. $fieldname .' = "'. $this->db->sql_escape($value) .'"';
+    /**
+     * Fetches the desired user row from database, specified by column and value
+     *
+     * @param string $fieldname Name of database column to identify user
+     * @param string $value     Value of $fieldname
+     *
+     * @return array Database row or boolean false
+     */
+    protected function _getuser($fieldname, $value)
+    {
+        $query = 'SELECT * FROM '. $this->getTableName()
+            . ' WHERE ' . $fieldname . ' = "' . $this->db->sql_escape($value) . '"';
 
-        if (! ($dbresult =& $this->db->sql_query($query)) ) {
-            message_die(GENERAL_ERROR, 'Could not get user', '', __LINE__, __FILE__, $query, $this->db);
+        if (!($dbresult = $this->db->sql_query($query)) ) {
+            message_die(
+                GENERAL_ERROR, 'Could not get user',
+                '', __LINE__, __FILE__, $query, $this->db
+            );
             return false;
         }
 
-        $row =& $this->db->sql_fetchrow($dbresult);
+        $row = $this->db->sql_fetchrow($dbresult);
         $this->db->sql_freeresult($dbresult);
         if ($row) {
             return $row;