Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
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.
 
 get_course_id ()
 Get the course id.
 
 get_first_post_id ()
 Get the id of the fist post in the discussion.
 
 get_forum_id ()
 Get the forum id.
 
 get_group_id ()
 Get the id of the group that this discussion belongs to.
 
 get_id ()
 Get the discussion id.
 
 get_locked ()
 Get the locked time of this discussion.
 
 get_name ()
 Get the name of the discussion.
 
 get_time_end ()
 Get the end time of this discussion.
 
 get_time_modified ()
 Get the timestamp for when this discussion was last modified.
 
 get_time_start ()
 Get the start time of this discussion.
 
 get_user_id ()
 Get the id of the user that created the discussion.
 
 get_user_modified ()
 Get the id of the user that last modified this discussion.
 
 has_ended ()
 Check if the discussion has ended.
 
 has_group ()
 Check if the discussion belongs to a group.
 
 has_started ()
 Check if the discussion has started yet.
 
 is_assessed ()
 Check if this discussion is assessed.
 
 is_first_post (post_entity $post)
 Check if the given post is the first post in this discussion.
 
 is_locked ()
 Is this discussion locked based on it's locked attribute.
 
 is_pinned ()
 Check if this discussion is pinned.
 
 is_timed_discussion ()
 Check if the discussion is timed.
 
 is_timed_discussion_visible ()
 Check if the timed discussion is visible.
 
 set_pinned (int $targetstate)
 Set the pinned value for this entity.
 
 toggle_locked_state (int $timestamp)
 Set the locked timestamp.
 

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: