Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Protected Member Functions | List of all members
tool_monitor\notification_task Class Reference

Adhock class, used to send notifications to users. More...

Inheritance diagram for tool_monitor\notification_task:
core\task\adhoc_task core\task\task_base

Public Member Functions

 execute ()
 Send out messages.
 
 get_component ()
 Getter for $component. More...
 
 get_cron_lock ()
 Get the current lock for the entire cron. More...
 
 get_custom_data ()
 Getter for $customdata. More...
 
 get_custom_data_as_string ()
 Alternate getter for $customdata. More...
 
 get_fail_delay ()
 Getter for $faildelay. More...
 
 get_id ()
 Getter for $id. More...
 
 get_lock ()
 Get the current lock for this task. More...
 
 get_next_run_time ()
 Get the next run time for this task. More...
 
 get_userid ()
 Getter for $userid. More...
 
 is_blocking ()
 Getter for $blocking. More...
 
 set_blocking ($blocking)
 Setter for $blocking. More...
 
 set_component ($component)
 Setter for $component. More...
 
 set_cron_lock (\core\lock\lock $lock)
 Set the current lock for the entire cron process. More...
 
 set_custom_data ($customdata)
 Setter for $customdata. More...
 
 set_custom_data_as_string ($customdata)
 Alternate setter for $customdata. More...
 
 set_fail_delay ($faildelay)
 Setter for $faildelay. More...
 
 set_id ($id)
 Setter for $id. More...
 
 set_lock (\core\lock\lock $lock)
 Set the current lock for this task. More...
 
 set_next_run_time ($nextruntime)
 Set the next run time for this task. More...
 
 set_userid ($userid)
 Setter for $userid. More...
 

Protected Member Functions

 generate_message ($subscriptionid, stdClass $eventobj)
 Generates the message object for a give subscription and event. More...
 
 replace_placeholders ($template, subscription $subscription, $eventobj, $context)
 Replace place holders in the template with respective content. More...
 

Detailed Description

Adhock class, used to send notifications to users.

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

Member Function Documentation

◆ generate_message()

tool_monitor\notification_task::generate_message (   $subscriptionid,
stdClass  $eventobj 
)
protected

Generates the message object for a give subscription and event.

Parameters
int$subscriptionidSubscription instance
stdClass$eventobjEvent data
Return values
false|stdClassmessage object

◆ get_component()

core\task\task_base::get_component ( )
inherited

Getter for $component.

Return values
string

◆ get_cron_lock()

core\task\task_base::get_cron_lock ( )
inherited

Get the current lock for the entire cron.

Return values
core

◆ 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
stringthis is the raw json encoded version.

◆ get_fail_delay()

core\task\task_base::get_fail_delay ( )
inherited

Getter for $faildelay.

Return values
int

◆ get_id()

core\task\adhoc_task::get_id ( )
inherited

Getter for $id.

Return values
int|null::$id

◆ get_lock()

core\task\task_base::get_lock ( )
inherited

Get the current lock for this task.

Return values
core

◆ get_next_run_time()

core\task\task_base::get_next_run_time ( )
inherited

Get the next run time for this task.

Return values
inttimestamp

◆ get_userid()

core\task\adhoc_task::get_userid ( )
inherited

Getter for $userid.

Return values
int|null::$userid

◆ is_blocking()

core\task\task_base::is_blocking ( )
inherited

Getter for $blocking.

Return values
bool

◆ replace_placeholders()

tool_monitor\notification_task::replace_placeholders (   $template,
subscription  $subscription,
  $eventobj,
  $context 
)
protected

Replace place holders in the template with respective content.

Parameters
string$templateMessage template.
subscription$subscriptionsubscription instance
stdclass$eventobjEvent data
context$contextcontext object
Return values
mixedfinal template string.

◆ set_blocking()

core\task\task_base::set_blocking (   $blocking)
inherited

Setter for $blocking.

Parameters
bool$blocking

◆ set_component()

core\task\task_base::set_component (   $component)
inherited

Setter for $component.

Parameters
string$component

◆ set_cron_lock()

core\task\task_base::set_cron_lock ( \core\lock\lock  $lock)
inherited

Set the current lock for the entire cron process.

Parameters
core\lock\lock$lock

◆ 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$customdatajson_encoded string

◆ set_fail_delay()

core\task\task_base::set_fail_delay (   $faildelay)
inherited

Setter for $faildelay.

Parameters
int$faildelay

◆ set_id()

core\task\adhoc_task::set_id (   $id)
inherited

Setter for $id.

Parameters
int | null$id

◆ set_lock()

core\task\task_base::set_lock ( \core\lock\lock  $lock)
inherited

Set the current lock for this task.

Parameters
core\lock\lock$lock

◆ set_next_run_time()

core\task\task_base::set_next_run_time (   $nextruntime)
inherited

Set the next run time for this task.

Parameters
int$nextruntime

◆ set_userid()

core\task\adhoc_task::set_userid (   $userid)
inherited

Setter for $userid.

Parameters
int | null$userid

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