OphCoTherapyapplication_FileCollection::cleanCompressedFile PHP Method

cleanCompressedFile() protected method

will also call the delete function on the protected file itself to remove orphaned files
protected cleanCompressedFile ( )
    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
                }
            }
        }
    }