Exemplo n.º 1
0
 /**
  * Create a new record for the object in database
  *
  * @return boolean
  */
 public function create()
 {
     $this->db->insert("classes", array("name" => $this->model->getName()));
     $this->model->setId($this->db->lastInsertId());
     $this->model->setCreationDate(time());
     $this->model->setModificationDate(time());
     $this->save();
 }
Exemplo n.º 2
0
 /**
  * Create a new record for the object in database
  *
  * @return boolean
  */
 public function create()
 {
     $this->db->insert("classes", array("name" => $this->model->getName()));
     // only for logging
     $this->logSql("INSERT INTO `classes` SET `name`=" . $this->db->quote($this->model->getName()) . ";");
     $this->model->setId($this->db->lastInsertId());
     $this->model->setCreationDate(time());
     $this->model->setModificationDate(time());
     $this->save();
 }