示例#1
0
 /**
  * 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();
 }
示例#2
0
 /**
  * Counts all associated IssueVotes
  * @return int
  */
 public function CountIssueVotes()
 {
     if (is_null($this->intId)) {
         return 0;
     }
     return IssueVote::CountByIssueId($this->intId);
 }