/** * This will clear or delete the vote on this issue by the given person (if applicable) * and refresh/udpate the vote count * @param Person $objPerson * @return void */ public function ClearVote(Person $objPerson) { $objVote = IssueVote::LoadByIssueIdPersonId($this->intId, $objPerson->Id); if ($objVote) { $objVote->Delete(); } $this->intVoteCount = IssueVote::CountByIssueId($this->intId); $this->Save(); }
/** * Counts all associated IssueVotes * @return int */ public function CountIssueVotes() { if (is_null($this->intId)) { return 0; } return IssueVote::CountByIssueId($this->intId); }