Adhoc task to send user forum notifications.
More...
|
| can_post ($course, $forum, $discussion, $post, $cm, $context) |
| Check whether the user can post. More...
|
|
| can_view_fullnames ($course, $forum, $discussion, $post, $cm, $context) |
| Check whether the user can view full names of other users. More...
|
|
| get_message_headers ($course, $forum, $discussion, $post, $a, $message) |
| Get the list of message headers. More...
|
|
| get_post_author ($userid, $course, $forum, $cm, $context) |
| Fetch and initialise the post author. More...
|
|
| get_renderer ($html=false) |
| Helper to fetch the required renderer, instantiating as required. More...
|
|
| get_reply_address ($course, $forum, $discussion, $post, $cm, $context) |
| Get a no-reply address for this user to reply to the current post. More...
|
|
| minimise_user_record (\stdClass $user) |
| Removes properties from user record that are not necessary for sending post notifications. More...
|
|
| prepare_data (array $postids) |
| Prepare all data for this run. More...
|
|
| send_post ($course, $forum, $discussion, $post, $cm, $context) |
| Send the specified post for the current user. More...
|
|
|
bool[] | $canpostto = [] |
| Whether the user can post in each discussion.
|
|
int[] | $courseforums = [] |
| List of IDs for forums in each course.
|
|
stdClass[] | $courses = [] |
| List of courses the messages are in, indexed by courseid.
|
|
stdClass[] | $discussions = [] |
| List of discussions the messages are in, indexed by forumid.
|
|
stdClass[] | $forumdiscussions = [] |
| List of IDs for discussions in each forum.
|
|
stdClass[] | $forums = [] |
| List of forums the messages are in, indexed by courseid.
|
|
core message inbound address_manager | $inboundmanager |
| The inbound message address manager.
|
|
stdClass[] | $posts = [] |
| List of posts the messages are in, indexed by discussionid.
|
|
stdClass | $recipient |
| A shortcut to $USER.
|
|
renderer[] | $renderers = [] |
| The renderers.
|
|
bool[] | $viewfullnames = [] |
| Whether the user can view fullnames for each forum.
|
|
Adhoc task to send user forum notifications.
- Copyright
- 2018 Andrew Nicols andre.nosp@m.w@ni.nosp@m.cols..nosp@m.co.u.nosp@m.k
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ can_post()
mod_forum\task\send_user_notifications::can_post |
( |
|
$course, |
|
|
|
$forum, |
|
|
|
$discussion, |
|
|
|
$post, |
|
|
|
$cm, |
|
|
|
$context |
|
) |
| |
|
protected |
Check whether the user can post.
- Parameters
-
stdClass | $course | |
stdClass | $forum | |
stdClass | $discussion | |
stdClass | $post | |
stdClass | $cm | |
context | $context | |
- Return values
-
◆ can_view_fullnames()
mod_forum\task\send_user_notifications::can_view_fullnames |
( |
|
$course, |
|
|
|
$forum, |
|
|
|
$discussion, |
|
|
|
$post, |
|
|
|
$cm, |
|
|
|
$context |
|
) |
| |
|
protected |
Check whether the user can view full names of other users.
- Parameters
-
stdClass | $course | |
stdClass | $forum | |
stdClass | $discussion | |
stdClass | $post | |
stdClass | $cm | |
context | $context | |
- Return values
-
◆ get_component()
core\task\task_base::get_component |
( |
| ) |
|
|
inherited |
Getter for $component.
- Return values
-
◆ get_cron_lock()
core\task\task_base::get_cron_lock |
( |
| ) |
|
|
inherited |
Get the current lock for the entire cron.
- Return values
-
◆ get_custom_data()
core\task\adhoc_task::get_custom_data |
( |
| ) |
|
|
inherited |
Getter for $customdata.
- Return values
-
mixed | (anything that can be handled by json_decode). |
◆ get_custom_data_as_string()
core\task\adhoc_task::get_custom_data_as_string |
( |
| ) |
|
|
inherited |
Alternate getter for $customdata.
- Return values
-
string | this is the raw json encoded version. |
◆ get_fail_delay()
core\task\task_base::get_fail_delay |
( |
| ) |
|
|
inherited |
Getter for $faildelay.
- Return values
-
◆ get_id()
core\task\adhoc_task::get_id |
( |
| ) |
|
|
inherited |
Getter for $id.
- Return values
-
◆ get_lock()
core\task\task_base::get_lock |
( |
| ) |
|
|
inherited |
Get the current lock for this task.
- Return values
-
◆ get_message_headers()
mod_forum\task\send_user_notifications::get_message_headers |
( |
|
$course, |
|
|
|
$forum, |
|
|
|
$discussion, |
|
|
|
$post, |
|
|
|
$a, |
|
|
|
$message |
|
) |
| |
|
protected |
Get the list of message headers.
- Parameters
-
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 |
- Return values
-
◆ get_next_run_time()
core\task\task_base::get_next_run_time |
( |
| ) |
|
|
inherited |
Get the next run time for this task.
- Return values
-
◆ get_post_author()
mod_forum\task\send_user_notifications::get_post_author |
( |
|
$userid, |
|
|
|
$course, |
|
|
|
$forum, |
|
|
|
$cm, |
|
|
|
$context |
|
) |
| |
|
protected |
Fetch and initialise the post author.
- Parameters
-
int | $userid | The id of the user to fetch |
stdClass | $course | |
stdClass | $forum | |
stdClass | $cm | |
context | $context | |
- Return values
-
◆ get_renderer()
mod_forum\task\send_user_notifications::get_renderer |
( |
|
$html = false | ) |
|
|
protected |
Helper to fetch the required renderer, instantiating as required.
- Parameters
-
bool | $html | Whether to fetch the HTML renderer |
- Return values
-
◆ get_reply_address()
mod_forum\task\send_user_notifications::get_reply_address |
( |
|
$course, |
|
|
|
$forum, |
|
|
|
$discussion, |
|
|
|
$post, |
|
|
|
$cm, |
|
|
|
$context |
|
) |
| |
|
protected |
Get a no-reply address for this user to reply to the current post.
- Parameters
-
stdClass | $course | |
stdClass | $forum | |
stdClass | $discussion | |
stdClass | $post | |
stdClass | $cm | |
context | $context | |
- Return values
-
◆ get_userid()
core\task\adhoc_task::get_userid |
( |
| ) |
|
|
inherited |
Getter for $userid.
- Return values
-
◆ is_blocking()
core\task\task_base::is_blocking |
( |
| ) |
|
|
inherited |
Getter for $blocking.
- Return values
-
◆ minimise_user_record()
mod_forum\task\send_user_notifications::minimise_user_record |
( |
\stdClass |
$user | ) |
|
|
protected |
Removes properties from user record that are not necessary for sending post notifications.
- Parameters
-
◆ prepare_data()
mod_forum\task\send_user_notifications::prepare_data |
( |
array |
$postids | ) |
|
|
protected |
Prepare all data for this run.
Take all post ids, and fetch the relevant authors, discussions, forums, and courses for them.
- Parameters
-
int[] | $postids | The list of post IDs |
◆ send_post()
mod_forum\task\send_user_notifications::send_post |
( |
|
$course, |
|
|
|
$forum, |
|
|
|
$discussion, |
|
|
|
$post, |
|
|
|
$cm, |
|
|
|
$context |
|
) |
| |
|
protected |
Send the specified post for the current user.
- Parameters
-
stdClass | $course | |
stdClass | $forum | |
stdClass | $discussion | |
stdClass | $post | |
stdClass | $cm | |
context | $context | |
◆ set_blocking()
core\task\task_base::set_blocking |
( |
|
$blocking | ) |
|
|
inherited |
Setter for $blocking.
- Parameters
-
◆ set_component()
core\task\task_base::set_component |
( |
|
$component | ) |
|
|
inherited |
Setter for $component.
- Parameters
-
◆ set_cron_lock()
Set the current lock for the entire cron process.
- Parameters
-
◆ set_custom_data()
core\task\adhoc_task::set_custom_data |
( |
|
$customdata | ) |
|
|
inherited |
Setter for $customdata.
- Parameters
-
mixed | $customdata | (anything that can be handled by json_encode) |
◆ set_custom_data_as_string()
core\task\adhoc_task::set_custom_data_as_string |
( |
|
$customdata | ) |
|
|
inherited |
Alternate setter for $customdata.
Expects the data as a json_encoded string.
- Parameters
-
string | $customdata | json_encoded string |
◆ set_fail_delay()
core\task\task_base::set_fail_delay |
( |
|
$faildelay | ) |
|
|
inherited |
Setter for $faildelay.
- Parameters
-
◆ set_id()
core\task\adhoc_task::set_id |
( |
|
$id | ) |
|
|
inherited |
Setter for $id.
- Parameters
-
◆ set_lock()
Set the current lock for this task.
- Parameters
-
◆ set_next_run_time()
core\task\task_base::set_next_run_time |
( |
|
$nextruntime | ) |
|
|
inherited |
Set the next run time for this task.
- Parameters
-
◆ set_userid()
core\task\adhoc_task::set_userid |
( |
|
$userid | ) |
|
|
inherited |
Setter for $userid.
- Parameters
-
The documentation for this class was generated from the following file: