/** * Delete an existing record - dynamic method: delete_PaForumThread() * * * Generated with the DalClassGenerator created by: * Zoran Hron <*****@*****.**> * * @param id * @result void **/ public function delete_PaForumThread($id) { $conditionalStatement = "thread_id = {$id} AND is_active = 1"; $thread_posts = PaForumPost::listPaForumPost($conditionalStatement); foreach ($thread_posts as $post) { PaForumPost::deletePaForumPost($post->get_id()); } // sql query $sql = "UPDATE { pa_forum_thread } SET is_active = 0 WHERE id = ?;"; $params = array($id); // performs deletion of data $res = Dal::query($sql, $params); }
private function handleGET_delPost($request_data) { global $error_msg; if ($this->user_status & PaForumsUsers::_owner || $this->user_status & PaForumsUsers::_admin) { try { PaForumPost::deletePaForumPost($request_data['post_id']); unset($request_data['post_id']); unset($request_data['action']); $msg = __("Post sucessfully deleted"); $this->redirectWithMessage($msg, $request_data, 'info_message'); } catch (Exception $e) { $error_msg = "Exception in ForumModule, function handleGET_delPost();<br />Message: " . $e->getMessage(); } } else { $error_msg = __("You don't have required permissions for this task!"); return 'skip'; } }