public function deleteModel($id)
    {
        if (($model = $this->loadModel($id)) === null) {
            throw new CException(sprintf('Failed to locate file model with id "%d".', $id));
        }
        $filePath = $model->resolvePath();
        if (file_exists($filePath) && !unlink($filePath)) {
            throw new CException('Failed to delete the file.');
        }
        if (!$model->delete()) {
            throw new CException('Failed to delete the file model.');
        }
        return true;
    }
public function deleteModel($id)
    {
        if (($model = $this->loadModel($id)) === null) {
            throw new CException(sprintf('Failed to locate file model with id "%d".', $id));
        }
        $filePath = $model->resolvePath();
        if (file_exists($filePath) && !unlink($filePath)) {
            throw new CException('Failed to delete the file.');
        }
        if (!$model->delete()) {
            throw new CException('Failed to delete the file model.');
        }
        return true;
    }
public function deleteModel ( $ id ) { if ( ( $ model = $ this -> loadModel ( $ id ) ) === null ) { throw new CException ( sprintf ( 'Failed to locate file model with id "%d".' , $ id ) ) ; } $ filePath = $ model -> resolvePath ( ) ; if ( file_exists ( $ filePath ) && ! unlink ( $ filePath ) ) { throw new CException ( 'Failed to delete the file.' ) ; } if ( ! $ model -> delete ( ) ) { throw new CException ( 'Failed to delete the file model.' ) ; } return true ; }
Deletes a file with the given id.
@param integer $id the file id.
@return boolean whether the file was successfully deleted.
@throws CException if deleting the file fails.
Deletes a file with the given id .