public function executeDeleteFile() { $cat_file = CatalogFilePeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($cat_file); $cat_file->delete(); return $this->redirect('catalog/edit?id=' . $this->getRequestParameter('catalog_id')); }
public function executeDeleteFile() { $cat_file = CatalogFilePeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($cat_file); $tmp_dir = sfConfig::get('sf_data_dir') . DIRECTORY_SEPARATOR . 'files' . DIRECTORY_SEPARATOR; unlink($tmp_dir . DIRECTORY_SEPARATOR . $cat_file->getFile()); $cat_file->delete(); return $this->redirect('collection/edit?id=' . $this->getRequestParameter('catalog_id')); }