示例#1
0
 /**
  * Create a new record for the object in database
  *
  * @return boolean
  */
 public function create()
 {
     try {
         $this->db->insert("plugin_ratingscomments_ratings", array("targetId" => $this->model->getTargetId(), "comment" => $this->model->getComment(), "date" => $this->model->getDate(), "type" => $this->model->getType(), "classname" => $this->model->getClassname(), "rating" => $this->model->getRating(), "metadata" => $this->model->getMetadata(), "title" => $this->model->getTitle(), "name" => $this->model->getName()));
         $this->model->setId($this->db->lastInsertId());
         return $this->save();
     } catch (Exception $e) {
         throw $e;
     }
 }