public function get_mark_post_as_read_url_from_post(post_entity $post, int $displaymode = FORUM_MODE_THREADED) : moodle_url {
        $params = [
            'd' => $post->get_discussion_id(),
            'postid' => $post->get_id(),
            'mark' => 'read'
        ];

        $url = new moodle_url('/mod/forum/discuss.php', $params);

        if ($displaymode == FORUM_MODE_THREADED) {
            $url->param('parent', $post->get_parent_id());
        } else {
            $url->set_anchor('p' . $post->get_id());
        }

        return $url;
    }
public function get_mark_post_as_read_url_from_post(post_entity $post, int $displaymode = FORUM_MODE_THREADED) : moodle_url {
        $params = [
            'd' => $post->get_discussion_id(),
            'postid' => $post->get_id(),
            'mark' => 'read'
        ];

        $url = new moodle_url('/mod/forum/discuss.php', $params);

        if ($displaymode == FORUM_MODE_THREADED) {
            $url->param('parent', $post->get_parent_id());
        } else {
            $url->set_anchor('p' . $post->get_id());
        }

        return $url;
    }
public function get_mark_post_as_read_url_from_post ( post_entity $ post , int $ displaymode = FORUM_MODE_THREADED ) : moodle_url { $ params = [ 'd' => $ post -> get_discussion_id ( ) , 'postid' => $ post -> get_id ( ) , 'mark' => 'read' ] ; $ url = new moodle_url ( '/mod/forum/discuss.php' , $ params ) ; if ( $ displaymode == FORUM_MODE_THREADED ) { $ url -> param ( 'parent' , $ post -> get_parent_id ( ) ) ; } else { $ url -> set_anchor ( 'p' . $ post -> get_id ( ) ) ; } return $ url ; }
Get the url to mark a post as read.

@param post_entity $post The post
@param int $displaymode The display mode to show the forum in after marking as read
@return moodle_url
Get the url to mark a post as read .