]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
use Poll_response::pkeyGet() in Poll::getResponse()
authorEvan Prodromou <evan@status.net>
Mon, 4 Jul 2011 19:47:36 +0000 (15:47 -0400)
committerEvan Prodromou <evan@status.net>
Mon, 4 Jul 2011 19:47:36 +0000 (15:47 -0400)
plugins/Poll/Poll.php

index 0c274341b2bbca204e32fed2b6c8b1cedf14690f..399d49240614585ef16952063484fb1732372315 100644 (file)
@@ -160,15 +160,9 @@ class Poll extends Managed_DataObject
      */
     function getResponse(Profile $profile)
     {
-        $pr = new Poll_response();
-        $pr->poll_id = $this->id;
-        $pr->profile_id = $profile->id;
-        $pr->find();
-        if ($pr->fetch()) {
-            return $pr;
-        } else {
-            return null;
-        }
+       $pr = Poll_response::pkeyGet(array('poll_id' => $this->id,
+                                                                          'profile_id' => $profile->id));
+       return $pr;
     }
 
     function countResponses()