Example #1
0
 /**
  * Save object to database
  *
  * @return void
  */
 public function delete()
 {
     $this->db->delete("object_query_" . $this->model->getClassId(), $this->db->quoteInto("oo_id = ?", $this->model->getId()));
     $this->db->delete("object_store_" . $this->model->getClassId(), $this->db->quoteInto("oo_id = ?", $this->model->getId()));
     $this->db->delete("object_relations_" . $this->model->getClassId(), $this->db->quoteInto("src_id = ?", $this->model->getId()));
     // delete fields wich have their own delete algorithm
     foreach ($this->model->getClass()->getFieldDefinitions() as $fd) {
         if (method_exists($fd, "delete")) {
             $fd->delete($this->model);
         }
     }
     parent::delete();
 }