public function deleteExportById($id) { $export = $this->getExportById($id); if ($export) { IOHelper::deleteFile($export->file); } return craft()->db->createCommand()->delete('amforms_exports', array('id' => $id)); }