use Poll_response::pkeyGet() in Poll::getResponse()
This commit is contained in:
parent
c468b0d7f3
commit
44753d64ea
@ -160,15 +160,9 @@ class Poll extends Managed_DataObject
|
|||||||
*/
|
*/
|
||||||
function getResponse(Profile $profile)
|
function getResponse(Profile $profile)
|
||||||
{
|
{
|
||||||
$pr = new Poll_response();
|
$pr = Poll_response::pkeyGet(array('poll_id' => $this->id,
|
||||||
$pr->poll_id = $this->id;
|
'profile_id' => $profile->id));
|
||||||
$pr->profile_id = $profile->id;
|
return $pr;
|
||||||
$pr->find();
|
|
||||||
if ($pr->fetch()) {
|
|
||||||
return $pr;
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function countResponses()
|
function countResponses()
|
||||||
|
Loading…
Reference in New Issue
Block a user