Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
|
Adhoc task to send user forum notifications. More...
Public Member Functions | |
execute () | |
Send out messages. | |
get_component () | |
Getter for $component. | |
get_concurrency_limit () | |
Returns effective concurrency limit for this task. | |
get_cron_lock () | |
Get the current lock for the entire cron. | |
get_custom_data () | |
Getter for $customdata. | |
get_custom_data_as_string () | |
Alternate getter for $customdata. | |
get_fail_delay () | |
Getter for $faildelay. | |
get_hostname () | |
Getter for $hostname. | |
get_id () | |
Getter for $id. | |
get_lock () | |
Get the current lock for this task. | |
get_name () | |
Provide default implementation of the task name for backward compatibility. | |
get_next_run_time () | |
Get the next run time for this task. | |
get_pid () | |
Getter for $pid. | |
get_runtime () | |
Returns task runtime. | |
get_runtime_result () | |
Returns if the task has been running for too long. | |
get_timestarted () | |
Getter for $timestarted. | |
get_userid () | |
Getter for $userid. | |
is_blocking () | |
Getter for $blocking. | |
is_component_enabled () | |
Informs whether the task's component is enabled. | |
release_concurrency_lock () | |
Release the concurrency lock for this task type. | |
set_blocking ($blocking) | |
Setter for $blocking. | |
set_component ($component) | |
Setter for $component. | |
set_concurrency_lock (\core\lock\lock $lock) | |
Sets concurrency task lock. | |
set_cron_lock (\core\lock\lock $lock) | |
Set the current lock for the entire cron process. | |
set_custom_data ($customdata) | |
Setter for $customdata. | |
set_custom_data_as_string ($customdata) | |
Alternate setter for $customdata. | |
set_fail_delay ($faildelay) | |
Setter for $faildelay. | |
set_hostname ($hostname=null) | |
Setter for $hostname. | |
set_id ($id) | |
Setter for $id. | |
set_lock (\core\lock\lock $lock) | |
Set the current lock for this task. | |
set_next_run_time ($nextruntime) | |
Set the next run time for this task. | |
set_pid ($pid=null) | |
Setter for $pid. | |
set_timestarted ($timestarted=null) | |
Setter for $timestarted. | |
set_userid ($userid) | |
Setter for $userid. | |
Protected Member Functions | |
can_post ($course, $forum, $discussion, $post, $cm, $context) | |
Check whether the user can post. | |
can_view_fullnames ($course, $forum, $discussion, $post, $cm, $context) | |
Check whether the user can view full names of other users. | |
get_default_concurrency_limit () | |
Returns default concurrency limit for this task. | |
get_message_headers ($course, $forum, $discussion, $post, $a, $message) | |
Get the list of message headers. | |
get_post_author ($userid, $course, $forum, $cm, $context) | |
Fetch and initialise the post author. | |
get_renderer ($html=false) | |
Helper to fetch the required renderer, instantiating as required. | |
get_reply_address ($course, $forum, $discussion, $post, $cm, $context) | |
Get a no-reply address for this user to reply to the current post. | |
minimise_user_record (\stdClass $user) | |
Removes properties from user record that are not necessary for sending post notifications. | |
prepare_data (array $postids) | |
Prepare all data for this run. | |
send_post ($course, $forum, $discussion, $post, $cm, $context) | |
Send the specified post for the current user. | |
Adhoc task to send user forum notifications.
|
protected |
Check whether the user can post.
stdClass | $course | |
stdClass | $forum | |
stdClass | $discussion | |
stdClass | $post | |
stdClass | $cm | |
context | $context |
bool |
|
protected |
Check whether the user can view full names of other users.
stdClass | $course | |
stdClass | $forum | |
stdClass | $discussion | |
stdClass | $post | |
stdClass | $cm | |
context | $context |
bool |
mod_forum\task\send_user_notifications::execute | ( | ) |
|
inherited |
Getter for $component.
string |
|
finalinherited |
Returns effective concurrency limit for this task.
int | effective concurrency limit for this task |
|
inherited |
Get the current lock for the entire cron.
core\lock\lock |
|
inherited |
Getter for $customdata.
mixed | (anything that can be handled by json_decode). |
|
inherited |
Alternate getter for $customdata.
string | this is the raw json encoded version. |
|
protectedinherited |
Returns default concurrency limit for this task.
int | default concurrency limit |
|
inherited |
Getter for $faildelay.
int |
|
inherited |
Getter for $hostname.
string |
|
inherited |
Getter for $id.
int|null\$id |
|
inherited |
Get the current lock for this task.
core\lock\lock |
|
protected |
Get the list of message headers.
stdClass | $course | |
stdClass | $forum | |
stdClass | $discussion | |
stdClass | $post | |
stdClass | $a | The list of strings for this post |
core\message\message | $message | The message to be sent |
stdClass |
|
inherited |
Provide default implementation of the task name for backward compatibility.
Extending classes are expected to implement this method to provide a descriptive name for the task (shown to admins)
string |
Reimplemented from core\task\task_base.
Reimplemented in core\task\badges_adhoc_task, core_reportbuilder\task\send_schedule, and quiz_statistics\task\recalculate.
|
inherited |
Get the next run time for this task.
int | timestamp |
|
inherited |
Getter for $pid.
int |
|
protected |
Fetch and initialise the post author.
int | $userid | The id of the user to fetch |
stdClass | $course | |
stdClass | $forum | |
stdClass | $cm | |
context | $context |
stdClass |
|
protected |
Helper to fetch the required renderer, instantiating as required.
bool | $html | Whether to fetch the HTML renderer |
core_renderer |
|
protected |
Get a no-reply address for this user to reply to the current post.
stdClass | $course | |
stdClass | $forum | |
stdClass | $discussion | |
stdClass | $post | |
stdClass | $cm | |
context | $context |
string |
|
inherited |
Returns task runtime.
int |
|
inherited |
Returns if the task has been running for too long.
result |
|
inherited |
Getter for $timestarted.
int |
|
inherited |
Getter for $userid.
int|null\$userid |
|
inherited |
Getter for $blocking.
bool |
|
inherited |
Informs whether the task's component is enabled.
bool | true when enabled. false otherwise. |
|
protected |
Removes properties from user record that are not necessary for sending post notifications.
stdClass | $user |
|
protected |
Prepare all data for this run.
Take all post ids, and fetch the relevant authors, discussions, forums, and courses for them.
int[] | $postids | The list of post IDs |
|
protected |
Send the specified post for the current user.
stdClass | $course | |
stdClass | $forum | |
stdClass | $discussion | |
stdClass | $post | |
stdClass | $cm | |
context | $context |
|
inherited |
Setter for $blocking.
bool | $blocking |
|
inherited |
Setter for $component.
string | $component |
|
finalinherited |
Sets concurrency task lock.
core\lock\lock | $lock | concurrency lock to be set |
|
inherited |
Set the current lock for the entire cron process.
core\lock\lock | $lock |
|
inherited |
Setter for $customdata.
mixed | $customdata | (anything that can be handled by json_encode) |
|
inherited |
Alternate setter for $customdata.
Expects the data as a json_encoded string.
string | $customdata | json_encoded string |
|
inherited |
Setter for $faildelay.
int | $faildelay |
|
inherited |
Setter for $hostname.
string | $hostname |
|
inherited |
Setter for $id.
int | null | $id |
|
inherited |
Set the current lock for this task.
core\lock\lock | $lock |
|
inherited |
Set the next run time for this task.
int | $nextruntime |
|
inherited |
Setter for $pid.
int | $pid |
|
inherited |
Setter for $timestarted.
int | $timestarted |
|
inherited |
Setter for $userid.
int | null | $userid |