This is a snippet from a class I am working with. Why does the delete() function call the save() function? Basically what should happen is new records are saved and old records are updated, and if a record needs to be deleted is should be marked as "deleted" by marking true or 1 in that mysql column.
Any insight is appreciated, or any opinions on this code (I co opted it and did not write it.... so feel free to be honest ;) )
public function save() {
if ($this->id == 0) {
$this->id = doInsert(self::db_table(), array(
array("name" => "id", "value" => 0)
));
}
doUpdate(self::db_table(), $this->id, array(
.
.
.
.
public function delete() {
if($this->id > 0) {
$this->deleted = true;
$this->save();
}
}