Commit c4e00629 authored by Alexander Butenko's avatar Alexander Butenko

Do not remove() if primary key is not set

parent 35a43d03
......@@ -82,6 +82,9 @@ abstract class dbObject {
}
public function remove () {
if (empty ($this->data[$this->primaryKey]))
return false;
$this->db->where ($this->primaryKey, $this->data[$this->primaryKey]);
return $this->db->delete ($this->dbTable);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment