public function execute(HTTPRequestCustom $request) { AppContext::get_session()->csrf_get_protect(); $this->get_downloadfile($request); $this->check_authorizations(); DownloadService::delete('WHERE id=:id', array('id' => $this->downloadfile->get_id())); DownloadService::get_keywords_manager()->delete_relations($this->downloadfile->get_id()); PersistenceContext::get_querier()->delete(DB_TABLE_EVENTS, 'WHERE module=:module AND id_in_module=:id', array('module' => 'download', 'id' => $this->downloadfile->get_id())); CommentsService::delete_comments_topic_module('download', $this->downloadfile->get_id()); NotationService::delete_notes_id_in_module('download', $this->downloadfile->get_id()); Feed::clear_cache('download'); DownloadCache::invalidate(); AppContext::get_response()->redirect($request->get_url_referrer() ? $request->get_url_referrer() : DownloadUrlBuilder::home(), StringVars::replace_vars(LangLoader::get_message('download.message.success.delete', 'common', 'download'), array('name' => $this->downloadfile->get_name()))); }