Exemple #1
0
 /**
  * Insert vote to DB
  * @return boolean
  */
 public function insert()
 {
     if (!$this->validate()) {
         return false;
     }
     $modelVote = new Model_Vote();
     $result = $modelVote->insert(array("fkEntryId" => $this->getFkEntryId(), "fkGroupId" => $this->getFkGroupId(), "ts" => $this->getTs()));
     if ($result === false) {
         // error
         $this->getErrorObj()->setError('VOTE_DB_ERROR');
         return false;
     } else {
         // all good
         $this->setId($result);
         return true;
     }
 }