Deprecated: Assigning the return value of new by reference is deprecated in /home/bluestat/public_html/source/index.php on line 477
Bugdar2 - Commitdiff - ViewGit - Blue Static

Fix BUG:K003 : Bug::FetchReporter() should return a User Model object.

Robert Sesek [2010-04-27 04:58]
Fix BUG:K003 : Bug::FetchReporter() should return a User Model object.
diff --git a/includes/model_bug.php b/includes/model_bug.php
index 9d3ac1b..13ad8e4 100644
--- a/includes/model_bug.php
+++ b/includes/model_bug.php
@@ -67,9 +67,8 @@ class Bug extends phalanx\data\Model
     // Returns the user who reported the bug.
     public function FetchReporter()
     {
-        // BUG:K003 : Bug::FetchReporter() should return a User Model object
-        $stmt = Bugdar::$db->Prepare("SELECT * FROM " . TABLE_PREFIX . "users WHERE user_id = ?");
-        $stmt->Execute(array($this->reporting_user_id));
-        return $stmt->FetchObject();
+        $user = new User($this->reporting_user_id);
+        $user->FetchInto();
+        return $user;
     }
 }