Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | List of all members
mod_forum\local\factories\url Class Reference

A URL factory for the forum. More...

Public Member Functions

 __construct (legacy_data_mapper_factory $legacydatamapperfactory)
 Constructor. More...
 
 get_author_group_url (\stdClass $group)
 Get the url to view an author's group. More...
 
 get_author_profile_image_url (author_entity $author, int $authorcontextid=null, int $size=100)
 Get the url to view the author's profile image. More...
 
 get_author_profile_url (author_entity $author, int $courseid)
 Get the url to view an author's profile. More...
 
 get_course_url_from_courseid (int $courseid)
 Get the course url from the given course id. More...
 
 get_course_url_from_forum (forum_entity $forum)
 Get the course url from the given forum entity. More...
 
 get_delete_post_url_from_post (post_entity $post)
 Get the url to delete a post. More...
 
 get_discussion_create_url (forum_entity $forum)
 Get the create discussion url for the given forum. More...
 
 get_discussion_subscribe_url (discussion_entity $discussion)
 Get the url to subscribe to a discussion. More...
 
 get_discussion_view_first_unread_post_url_from_discussion (discussion_entity $discussion)
 Get the url to view the first unread post in a discussion. More...
 
 get_discussion_view_latest_post_url_from_discussion (discussion_entity $discussion, ?int $latestpost)
 Get the url to view the latest post in a discussion. More...
 
 get_discussion_view_url_from_discussion (discussion_entity $discussion)
 Get the view discussion url from the given discussion. More...
 
 get_discussion_view_url_from_discussion_id (int $discussionid)
 Get the view discussion url from the given discussion id. More...
 
 get_discussion_view_url_from_post (post_entity $post)
 Get the url to view a discussion from a post. More...
 
 get_edit_post_url_from_post (forum_entity $forum, post_entity $post)
 Get the url to edit a post. More...
 
 get_export_attachment_url_from_post_and_attachment (post_entity $post, stored_file $attachment)
 Get the url to export attachments for a post. More...
 
 get_export_post_url_from_post (post_entity $post)
 Get the url to export (see portfolios) a post. More...
 
 get_forum_view_url_from_course_module_id (int $coursemoduleid, ?int $pageno=null, ?int $sortorder=null)
 Get the view forum url for the given course module id and optionally a page number. More...
 
 get_forum_view_url_from_forum (forum_entity $forum, ?int $pageno=null, ?int $sortorder=null)
 Get the view forum url for the given forum and optionally a page number. More...
 
 get_mark_all_discussions_as_read_url (forum_entity $forum)
 Get the url to mark all discussions as read. More...
 
 get_mark_discussion_as_read_url_from_discussion (forum_entity $forum, discussion_entity $discussion)
 Get the url to mark a discussion as read. More...
 
 get_mark_post_as_read_url_from_post (post_entity $post, int $displaymode=FORUM_MODE_THREADED)
 Get the url to mark a post as read. More...
 
 get_mark_post_as_unread_url_from_post (post_entity $post, int $displaymode=FORUM_MODE_THREADED)
 Get the url to mark a post as unread. More...
 
 get_pin_discussion_url_from_discussion (discussion_entity $discussion)
 Generate the pinned discussion link. More...
 
 get_reply_to_post_url_from_post (post_entity $post)
 Get the url to reply to a post. More...
 
 get_split_discussion_at_post_url_from_post (post_entity $post)
 Get the url to split a discussion at a post. More...
 
 get_view_isolated_post_url_from_post (post_entity $post)
 Get the url to view a post and it's replies in isolation without the rest of the discussion. More...
 
 get_view_isolated_post_url_from_post_id (int $discussionid, int $postid)
 Get the url to view a post and it's replies in isolation without the rest of the discussion. More...
 
 get_view_post_url_from_post (post_entity $post)
 Get the url to view a post in the context of the rest of the discussion. More...
 
 get_view_post_url_from_post_id (int $discussionid, int $postid)
 Get the url to view a discussion from a discussion id and post id. More...
 

Detailed Description

A URL factory for the forum.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

mod_forum\local\factories\url::__construct ( legacy_data_mapper_factory  $legacydatamapperfactory)

Constructor.

Parameters
legacy_data_mapper_factory$legacydatamapperfactoryLegacy data mapper factory

Member Function Documentation

◆ get_author_group_url()

mod_forum\local\factories\url::get_author_group_url ( \stdClass  $group)

Get the url to view an author's group.

Parameters
stdClass$groupThe group
Return values
moodle_url

◆ get_author_profile_image_url()

mod_forum\local\factories\url::get_author_profile_image_url ( author_entity  $author,
int  $authorcontextid = null,
int  $size = 100 
)

Get the url to view the author's profile image.

The author's context id should be provided to prevent the code from needing to load it.

Parameters
author_entity$authorThe author
int | null$authorcontextidThe author context id
int$sizeThe size of the image to return
Return values
moodle_url

◆ get_author_profile_url()

mod_forum\local\factories\url::get_author_profile_url ( author_entity  $author,
int  $courseid 
)

Get the url to view an author's profile.

Parameters
author_entity$authorThe author
int$courseidThe course id
Return values
moodle_url

◆ get_course_url_from_courseid()

mod_forum\local\factories\url::get_course_url_from_courseid ( int  $courseid)

Get the course url from the given course id.

Parameters
int$courseidThe course id
Return values
moodle_url

◆ get_course_url_from_forum()

mod_forum\local\factories\url::get_course_url_from_forum ( forum_entity  $forum)

Get the course url from the given forum entity.

Parameters
forum_entity$forumThe forum entity
Return values
moodle_url

◆ get_delete_post_url_from_post()

mod_forum\local\factories\url::get_delete_post_url_from_post ( post_entity  $post)

Get the url to delete a post.

Parameters
post_entity$postThe post
Return values
moodle_url

◆ get_discussion_create_url()

mod_forum\local\factories\url::get_discussion_create_url ( forum_entity  $forum)

Get the create discussion url for the given forum.

Parameters
forum_entity$forumThe forum entity
Return values
moodle_url

◆ get_discussion_subscribe_url()

mod_forum\local\factories\url::get_discussion_subscribe_url ( discussion_entity  $discussion)

Get the url to subscribe to a discussion.

Parameters
discussion_entity$discussionThe discussion
Return values
moodle_url

◆ get_discussion_view_first_unread_post_url_from_discussion()

mod_forum\local\factories\url::get_discussion_view_first_unread_post_url_from_discussion ( discussion_entity  $discussion)

Get the url to view the first unread post in a discussion.

Parameters
discussion_entity$discussionThe discussion
Return values
moodle_url

◆ get_discussion_view_latest_post_url_from_discussion()

mod_forum\local\factories\url::get_discussion_view_latest_post_url_from_discussion ( discussion_entity  $discussion,
?int  $latestpost 
)

Get the url to view the latest post in a discussion.

Parameters
discussion_entity$discussionThe discussion
int | null$latestpostThe id of the latest post
Return values
moodle_url

◆ get_discussion_view_url_from_discussion()

mod_forum\local\factories\url::get_discussion_view_url_from_discussion ( discussion_entity  $discussion)

Get the view discussion url from the given discussion.

Parameters
discussion_entity$discussionThe discussion
Return values
moodle_url

◆ get_discussion_view_url_from_discussion_id()

mod_forum\local\factories\url::get_discussion_view_url_from_discussion_id ( int  $discussionid)

Get the view discussion url from the given discussion id.

Parameters
int$discussionidThe discussion id
Return values
moodle_url

◆ get_discussion_view_url_from_post()

mod_forum\local\factories\url::get_discussion_view_url_from_post ( post_entity  $post)

Get the url to view a discussion from a post.

Parameters
post_entity$postThe post
Return values
moodle_url

◆ get_edit_post_url_from_post()

mod_forum\local\factories\url::get_edit_post_url_from_post ( forum_entity  $forum,
post_entity  $post 
)

Get the url to edit a post.

Parameters
forum_entity$forumThe forum the post belongs to
post_entity$postThe post
Return values
moodle_url

◆ get_export_attachment_url_from_post_and_attachment()

mod_forum\local\factories\url::get_export_attachment_url_from_post_and_attachment ( post_entity  $post,
stored_file  $attachment 
)

Get the url to export attachments for a post.

Parameters
post_entity$postThe post
stored_file$attachment
Return values
moodle_url|null

◆ get_export_post_url_from_post()

mod_forum\local\factories\url::get_export_post_url_from_post ( post_entity  $post)

Get the url to export (see portfolios) a post.

Parameters
post_entity$postThe post
Return values
moodle_url

◆ get_forum_view_url_from_course_module_id()

mod_forum\local\factories\url::get_forum_view_url_from_course_module_id ( int  $coursemoduleid,
?int  $pageno = null,
?int  $sortorder = null 
)

Get the view forum url for the given course module id and optionally a page number.

Parameters
int$coursemoduleidThe course module id
int | null$pagenoThe page number
int | null$sortorderThe sorting order
Return values
moodle_url

◆ get_forum_view_url_from_forum()

mod_forum\local\factories\url::get_forum_view_url_from_forum ( forum_entity  $forum,
?int  $pageno = null,
?int  $sortorder = null 
)

Get the view forum url for the given forum and optionally a page number.

Parameters
forum_entity$forumThe forum entity
int | null$pagenoThe page number
int | null$sortorderThe sorting order
Return values
moodle_url

◆ get_mark_all_discussions_as_read_url()

mod_forum\local\factories\url::get_mark_all_discussions_as_read_url ( forum_entity  $forum)

Get the url to mark all discussions as read.

Parameters
forum_entity$forumThe forum that the discussions belong to
Return values
moodle_url

◆ get_mark_discussion_as_read_url_from_discussion()

mod_forum\local\factories\url::get_mark_discussion_as_read_url_from_discussion ( forum_entity  $forum,
discussion_entity  $discussion 
)

Get the url to mark a discussion as read.

Parameters
forum_entity$forumThe forum that the discussion belongs to
discussion_entity$discussionThe discussion
Return values
moodle_url

◆ get_mark_post_as_read_url_from_post()

mod_forum\local\factories\url::get_mark_post_as_read_url_from_post ( post_entity  $post,
int  $displaymode = FORUM_MODE_THREADED 
)

Get the url to mark a post as read.

Parameters
post_entity$postThe post
int$displaymodeThe display mode to show the forum in after marking as read
Return values
moodle_url

◆ get_mark_post_as_unread_url_from_post()

mod_forum\local\factories\url::get_mark_post_as_unread_url_from_post ( post_entity  $post,
int  $displaymode = FORUM_MODE_THREADED 
)

Get the url to mark a post as unread.

Parameters
post_entity$postThe post
int$displaymodeThe display mode to show the forum in after marking as unread
Return values
moodle_url

◆ get_pin_discussion_url_from_discussion()

mod_forum\local\factories\url::get_pin_discussion_url_from_discussion ( discussion_entity  $discussion)

Generate the pinned discussion link.

Parameters
discussion_entity$discussion
Return values
moodle_url
Exceptions
moodle_exception

◆ get_reply_to_post_url_from_post()

mod_forum\local\factories\url::get_reply_to_post_url_from_post ( post_entity  $post)

Get the url to reply to a post.

Parameters
post_entity$postThe post
Return values
moodle_url

◆ get_split_discussion_at_post_url_from_post()

mod_forum\local\factories\url::get_split_discussion_at_post_url_from_post ( post_entity  $post)

Get the url to split a discussion at a post.

Parameters
post_entity$postThe post
Return values
moodle_url

◆ get_view_isolated_post_url_from_post()

mod_forum\local\factories\url::get_view_isolated_post_url_from_post ( post_entity  $post)

Get the url to view a post and it's replies in isolation without the rest of the discussion.

Parameters
post_entity$postThe post
Return values
moodle_url

◆ get_view_isolated_post_url_from_post_id()

mod_forum\local\factories\url::get_view_isolated_post_url_from_post_id ( int  $discussionid,
int  $postid 
)

Get the url to view a post and it's replies in isolation without the rest of the discussion.

Parameters
int$discussionidThe discussion id
int$postidThe post id
Return values
moodle_url

◆ get_view_post_url_from_post()

mod_forum\local\factories\url::get_view_post_url_from_post ( post_entity  $post)

Get the url to view a post in the context of the rest of the discussion.

Parameters
post_entity$postThe post
Return values
moodle_url

◆ get_view_post_url_from_post_id()

mod_forum\local\factories\url::get_view_post_url_from_post_id ( int  $discussionid,
int  $postid 
)

Get the url to view a discussion from a discussion id and post id.

Parameters
int$discussionidThe discussion id
int$postidThe post id
Return values
moodle_url

The documentation for this class was generated from the following file: