protected function cleanCompressedFile()
{
// note we have to work on the file id not the relation
if ($id = $this->zipfile_id) {
$this->zipfile_id = null;
if ($this->save()) {
$pf = ProtectedFile::model()->findByPk($id);
try {
$pf->delete();
} catch (Exception $e) {
// ignore this exception as it's because the compressed file is referenced elsewhere
}
}
}
}