Differential D21847 Diff 52071 src/applications/slowvote/controller/PhabricatorSlowvoteVoteController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/slowvote/controller/PhabricatorSlowvoteVoteController.php
Show All 15 Lines | $poll = id(new PhabricatorSlowvoteQuery()) | ||||
->withIDs(array($id)) | ->withIDs(array($id)) | ||||
->needOptions(true) | ->needOptions(true) | ||||
->needViewerChoices(true) | ->needViewerChoices(true) | ||||
->executeOne(); | ->executeOne(); | ||||
if (!$poll) { | if (!$poll) { | ||||
return new Aphront404Response(); | return new Aphront404Response(); | ||||
} | } | ||||
if ($poll->getIsClosed()) { | if ($poll->isClosed()) { | ||||
return new Aphront400Response(); | return new Aphront400Response(); | ||||
} | } | ||||
$options = $poll->getOptions(); | $options = $poll->getOptions(); | ||||
$options = mpull($options, null, 'getID'); | $options = mpull($options, null, 'getID'); | ||||
$old_votes = $poll->getViewerChoices($viewer); | $old_votes = $poll->getViewerChoices($viewer); | ||||
$old_votes = mpull($old_votes, null, 'getOptionID'); | $old_votes = mpull($old_votes, null, 'getOptionID'); | ||||
▲ Show 20 Lines • Show All 74 Lines • Show Last 20 Lines |