From: Evan Prodromou Date: Mon, 4 Jul 2011 19:47:36 +0000 (-0400) Subject: use Poll_response::pkeyGet() in Poll::getResponse() X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=44753d64ea024d449eef1f61549d20755d9fca99;p=quix0rs-gnu-social.git use Poll_response::pkeyGet() in Poll::getResponse() --- diff --git a/plugins/Poll/Poll.php b/plugins/Poll/Poll.php index 0c274341b2..399d492406 100644 --- a/plugins/Poll/Poll.php +++ b/plugins/Poll/Poll.php @@ -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()