public function delete()
{
try {
$this->deleteAllProperties();
$this->db->delete("documents_email", $this->db->quoteInto("id = ?", $this->model->getId()));
//deleting log files
$this->db->delete("email_log", $this->db->quoteInto("documentId = ?", $this->model->getId()));
parent::delete();
} catch (\Exception $e) {
throw $e;
}
}