/** * Delete the object. * If we're using logical deletion, mark it deleted and save it, otherwise, delete as usual * * @see active_record::delete() */ public function delete() { if ($this->use_logical_deletion()) { db_update($this->get_table_name())->fields(array('deleted' => 'Yes'))->condition($this->get_table_primary_key(), $this->get_id())->execute(); return TRUE; } else { return parent::delete(); } }