Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
core\moodlenet\share_recorder Class Reference

Static Public Member Functions

static insert_share_progress (int $sharetype, int $userid, int $courseid, ?int $cmid=null)
 Create a new share progress record in the DB.
 
static update_share_progress (int $shareid, int $status, ?string $resourceurl=null)
 Update the share progress record in the DB.
 

Public Attributes

int const STATUS_ERROR = 3
 The status of the share is 'error'.
 
int const STATUS_IN_PROGRESS = 2
 The status of the share is 'in progress'.
 
int const STATUS_SENT = 1
 The status of the share is 'sent'.
 
int const TYPE_ACTIVITY = 2
 The content being shared is an activity.
 
int const TYPE_COURSE = 1
 The content being shared is a course.
 

Static Protected Member Functions

static get_allowed_share_statuses ()
 Get all allowed share statuses.
 
static get_allowed_share_types ()
 Get all allowed share types.
 

Member Function Documentation

◆ get_allowed_share_statuses()

static core\moodlenet\share_recorder::get_allowed_share_statuses ( )
staticprotected

Get all allowed share statuses.

Note that the particular status values aid in sorting.

Return values
array

◆ get_allowed_share_types()

static core\moodlenet\share_recorder::get_allowed_share_types ( )
staticprotected

Get all allowed share types.

Return values
array

◆ insert_share_progress()

static core\moodlenet\share_recorder::insert_share_progress ( int $sharetype,
int $userid,
int $courseid,
?int $cmid = null )
static

Create a new share progress record in the DB.

Parameters
int$sharetypeThe type of share (e.g. TYPE_COURSE).
int$useridThe ID of the user performing the share.
int$courseidThe associated course id.
int | null$cmidThe associated course module id (when sharing activity).
Return values
intReturns the inserted record id.

◆ update_share_progress()

static core\moodlenet\share_recorder::update_share_progress ( int $shareid,
int $status,
?string $resourceurl = null )
static

Update the share progress record in the DB.

Parameters
int$shareidThe id of the share progress row being updated.
int$statusThe status of the share progress (e.g. STATUS_SENT).
string | null$resourceurlThe resource url returned from MoodleNet.

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