function delete() { $row = $this->get(); $att = $this->formatAttachments($row->attachments); $this->deleteTmpMedia($att); parent::delete(); }