/** * We remove the file on the adapter before removing it in DB. * * @return int */ public function delete() { if (!empty($this->adapter)) { $staticAdapter = Media_Model_Adapter::factory($this->adapter, unserialize($this->params)); $staticAdapter->delete($this->dest); } return parent::delete(); }
public function delete() { if ($this->file_id !== null && $this->getTable()->select(true)->where('file_id=?', $this->file_id)->count() == 1) { unlink(Centurion_Config_Manager::get('media.uploads_dir') . DIRECTORY_SEPARATOR . $this->local_filename); } parent::delete(); }
/** * @return int */ public function delete() { if ($this->delete_original == '1') { if ($this->file_id !== null && $this->getTable()->select(true)->where('file_id=?', $this->file_id)->count() == 1) { unlink($this->getFullLocalPath()); } } return parent::delete(); }