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

Discussion class. More...

Public Member Functions

 __construct (int $id, int $courseid, int $forumid, string $name, int $firstpostid, int $userid, int $groupid, bool $assessed, int $timemodified, int $usermodified, int $timestart, int $timeend, bool $pinned, int $locked)
 Constructor. More...
 
 get_course_id ()
 Get the course id. More...
 
 get_first_post_id ()
 Get the id of the fist post in the discussion. More...
 
 get_forum_id ()
 Get the forum id. More...
 
 get_group_id ()
 Get the id of the group that this discussion belongs to. More...
 
 get_id ()
 Get the discussion id. More...
 
 get_locked ()
 Get the locked time of this discussion. More...
 
 get_name ()
 Get the name of the discussion. More...
 
 get_time_end ()
 Get the end time of this discussion. More...
 
 get_time_modified ()
 Get the timestamp for when this discussion was last modified. More...
 
 get_time_start ()
 Get the start time of this discussion. More...
 
 get_user_id ()
 Get the id of the user that created the discussion. More...
 
 get_user_modified ()
 Get the id of the user that last modified this discussion. More...
 
 has_ended ()
 Check if the discussion has ended. More...
 
 has_group ()
 Check if the discussion belongs to a group. More...
 
 has_started ()
 Check if the discussion has started yet. More...
 
 is_assessed ()
 Check if this discussion is assessed. More...
 
 is_first_post (post_entity $post)
 Check if the given post is the first post in this discussion. More...
 
 is_locked ()
 Is this discussion locked based on it's locked attribute. More...
 
 is_pinned ()
 Check if this discussion is pinned. More...
 
 is_timed_discussion ()
 Check if the discussion is timed. More...
 
 is_timed_discussion_visible ()
 Check if the timed discussion is visible. More...
 
 set_pinned (int $targetstate)
 Set the pinned value for this entity. More...
 
 toggle_locked_state (int $timestamp)
 Set the locked timestamp. More...
 

Detailed Description

Discussion class.

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

Constructor & Destructor Documentation

◆ __construct()

mod_forum\local\entities\discussion::__construct ( int  $id,
int  $courseid,
int  $forumid,
string  $name,
int  $firstpostid,
int  $userid,
int  $groupid,
bool  $assessed,
int  $timemodified,
int  $usermodified,
int  $timestart,
int  $timeend,
bool  $pinned,
int  $locked 
)

Constructor.

Parameters
int$idID
int$courseidCourse id
int$forumidForum id
string$nameDiscussion name
int$firstpostidId of the first post in the discussion
int$useridId of the user that created the discussion
int$groupidGroup id if it's a group dicussion
bool$assessedIs the discussion assessed?
int$timemodifiedTimestamp for last modification to the discussion
int$usermodifiedId of user that last modified the discussion
int$timestartStart time for the discussion
int$timeendEnd time for the discussion
bool$pinnedIs the discussion pinned?
int$lockedTime this discussion was locked

Member Function Documentation

◆ get_course_id()

mod_forum\local\entities\discussion::get_course_id ( )

Get the course id.

Return values
int

◆ get_first_post_id()

mod_forum\local\entities\discussion::get_first_post_id ( )

Get the id of the fist post in the discussion.

Return values
int

◆ get_forum_id()

mod_forum\local\entities\discussion::get_forum_id ( )

Get the forum id.

Return values
int

◆ get_group_id()

mod_forum\local\entities\discussion::get_group_id ( )

Get the id of the group that this discussion belongs to.

Return values
int

◆ get_id()

mod_forum\local\entities\discussion::get_id ( )

Get the discussion id.

Return values
int

◆ get_locked()

mod_forum\local\entities\discussion::get_locked ( )

Get the locked time of this discussion.

Return values
bool

◆ get_name()

mod_forum\local\entities\discussion::get_name ( )

Get the name of the discussion.

Return values
string

◆ get_time_end()

mod_forum\local\entities\discussion::get_time_end ( )

Get the end time of this discussion.

Returns zero if the discussion has no designated end time.

Return values
int

◆ get_time_modified()

mod_forum\local\entities\discussion::get_time_modified ( )

Get the timestamp for when this discussion was last modified.

Return values
int

◆ get_time_start()

mod_forum\local\entities\discussion::get_time_start ( )

Get the start time of this discussion.

Returns zero if the discussion has no designated start time.

Return values
int

◆ get_user_id()

mod_forum\local\entities\discussion::get_user_id ( )

Get the id of the user that created the discussion.

Return values
int

◆ get_user_modified()

mod_forum\local\entities\discussion::get_user_modified ( )

Get the id of the user that last modified this discussion.

Return values
int

◆ has_ended()

mod_forum\local\entities\discussion::has_ended ( )

Check if the discussion has ended.

DEFAULTS: false if not set

Return values
bool

◆ has_group()

mod_forum\local\entities\discussion::has_group ( )

Check if the discussion belongs to a group.

Return values
bool

◆ has_started()

mod_forum\local\entities\discussion::has_started ( )

Check if the discussion has started yet.

DEFAULTS: true if not set

Return values
bool

◆ is_assessed()

mod_forum\local\entities\discussion::is_assessed ( )

Check if this discussion is assessed.

Return values
bool

◆ is_first_post()

mod_forum\local\entities\discussion::is_first_post ( post_entity  $post)

Check if the given post is the first post in this discussion.

Parameters
post_entity$postThe post to check
Return values
bool

◆ is_locked()

mod_forum\local\entities\discussion::is_locked ( )

Is this discussion locked based on it's locked attribute.

Return values
bool

◆ is_pinned()

mod_forum\local\entities\discussion::is_pinned ( )

Check if this discussion is pinned.

Return values
bool

◆ is_timed_discussion()

mod_forum\local\entities\discussion::is_timed_discussion ( )

Check if the discussion is timed.

Return values
bool

◆ is_timed_discussion_visible()

mod_forum\local\entities\discussion::is_timed_discussion_visible ( )

Check if the timed discussion is visible.

Return values
bool

◆ set_pinned()

mod_forum\local\entities\discussion::set_pinned ( int  $targetstate)

Set the pinned value for this entity.

Parameters
int$targetstateThe state to change the pin to
Return values
bool

◆ toggle_locked_state()

mod_forum\local\entities\discussion::toggle_locked_state ( int  $timestamp)

Set the locked timestamp.

Parameters
int$timestampThe value we want to store into 'locked'

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