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