Moodle APIs
3.8
Moodle 3.8.6 (Build: 20201109)
|
Abstract class defining a scheduled task. More...
Public Member Functions | |
eval_cron_field ($field, $min, $max) | |
Take a cron field definition and return an array of valid numbers with the range min-max. More... | |
execute () | |
Do the job. More... | |
get_component () | |
Getter for $component. More... | |
get_cron_lock () | |
Get the current lock for the entire cron. More... | |
get_day () | |
Getter for $day. More... | |
get_day_of_week () | |
Getter for $dayofweek. More... | |
get_disabled () | |
Getter for $disabled. More... | |
get_fail_delay () | |
Getter for $faildelay. More... | |
get_hour () | |
Getter for $hour. More... | |
get_last_run_time () | |
Get the last run time for this scheduled task. More... | |
get_lock () | |
Get the current lock for this task. More... | |
get_minute () | |
Getter for $minute. More... | |
get_month () | |
Getter for $month. More... | |
get_name () | |
Get a descriptive name for this task (shown to admins). More... | |
get_next_run_time () | |
Get the next run time for this task. More... | |
get_next_scheduled_time () | |
Calculate when this task should next be run based on the schedule. More... | |
get_run_if_component_disabled () | |
Override this function if you want this scheduled task to run, even if the component is disabled. More... | |
is_blocking () | |
Getter for $blocking. More... | |
is_customised () | |
Has this task been changed from it's default config? 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_customised ($customised) | |
Has this task been changed from it's default config? More... | |
set_day ($day) | |
Setter for $day. More... | |
set_day_of_week ($dayofweek) | |
Setter for $dayofweek. More... | |
set_disabled ($disabled) | |
Setter for $disabled. More... | |
set_fail_delay ($faildelay) | |
Setter for $faildelay. More... | |
set_hour ($hour) | |
Setter for $hour. More... | |
set_last_run_time ($lastruntime) | |
Set the last run time for this scheduled task. More... | |
set_lock (\core\lock\lock $lock) | |
Set the current lock for this task. More... | |
set_minute ($minute) | |
Setter for $minute. More... | |
set_month ($month) | |
Setter for $month. More... | |
set_next_run_time ($nextruntime) | |
Set the next run time for this task. More... | |
Public Attributes | |
const | DAYOFWEEKMAX = 6 |
Maximum dayofweek value. | |
const | DAYOFWEEKMIN = 0 |
Minimum dayofweek value. | |
const | HOURMAX = 23 |
Maximum hour value. | |
const | HOURMIN = 0 |
Minimum hour value. | |
const | MINUTEMAX = 59 |
Maximum minute value. | |
const | MINUTEMIN = 0 |
Minimum minute value. | |
Abstract class defining a scheduled task.
core\task\scheduled_task::eval_cron_field | ( | $field, | |
$min, | |||
$max | |||
) |
Take a cron field definition and return an array of valid numbers with the range min-max.
string | $field | - The field definition. |
int | $min | - The minimum allowable value. |
int | $max | - The maximum allowable value. |
array(int) |
|
abstractinherited |
Do the job.
Throw exceptions on errors (the job will be retried).
Reimplemented in repository_onedrive\remove_temp_access_task, repository_filesystem\task\cron_task, repository_dropbox\task\cron_task, qtype_random\task\remove_unused_questions, mod_workshop\task\legacy_workshop_allocation_cron, mod_workshop\task\cron_task, workshopallocation_scheduled\task\cron_task, mod_scorm\task\cron_task, quiz_statistics\task\quiz_statistics_cleanup, mod_quiz\task\update_overdue_attempts, mod_quiz\task\legacy_quiz_reports_cron, mod_quiz\task\legacy_quiz_accessrules_cron, ltiservice_gradebookservices\task\cleanup_task, mod_lti\task\clean_access_tokens, mod_forum\task\send_user_notifications, mod_forum\task\send_user_digests, mod_forum\task\refresh_forum_post_counts, mod_forum\task\cron_task, mod_chat\task\cron_task, assignfeedback_editpdf\task\convert_submissions, mod_assign\task\cron_task, message_email\task\send_email_task, core_message\task\migrate_message_data, editor_atto\task\autosave_cleanup_task, core\task\task_log_cleanup_task, core\task\tag_cron_task, core\task\sync_plans_from_template_cohorts_task, core\task\stats_cron_task, core\task\session_cleanup_task, core\task\send_new_user_passwords_task, core\task\send_failed_login_notifications_task, core\task\search_optimize_task, core\task\search_index_task, core\task\registration_cron_task, core\task\refresh_mod_calendar_events_task, core\task\question_stats_cleanup_task, core\task\question_preview_cleanup_task, core\task\portfolio_cron_task, core\task\plagiarism_cron_task, core\task\password_reset_cleanup_task, core\task\messaging_cleanup_task, core\task\legacy_plugin_cron_task, core\task\h5p_get_content_types_task, core\task\grade_history_cleanup_task, core\task\grade_cron_task, core\task\file_trash_cleanup_task, core\task\file_temp_cleanup_task, core\task\delete_unconfirmed_users_task, core\task\delete_incomplete_users_task, core\task\create_contexts_task, core\task\context_cleanup_task, core\task\completion_regular_task, core\task\completion_daily_task, core\task\complete_plans_task, core\task\clean_up_deleted_search_area_task, core\task\check_for_updates_task, core\task\calendar_cron_task, core\task\cache_cron_task, core\task\cache_cleanup_task, core\task\build_installed_themes_task, core\task\blog_cron_task, core\task\badges_message_task, core\task\badges_cron_task, core\task\backup_cleanup_task, core\task\automated_backup_task, core\task\asynchronous_restore_task, core\task\asynchronous_backup_task, core\task\analytics_cleanup_task, core\oauth2\refresh_system_tokens_task, core_files\task\conversion_cleanup_task, enrol_self\task\sync_enrolments, enrol_self\task\send_expiry_notifications, enrol_paypal\task\process_expirations, enrol_meta\task\enrol_meta_sync, enrol_manual\task\sync_enrolments, enrol_manual\task\send_expiry_notifications, enrol_lti\task\sync_members, enrol_lti\task\sync_grades, enrol_ldap\task\sync_enrolments, enrol_imsenterprise\task\cron_task, enrol_flatfile\task\flatfile_sync_task, enrol_database\task\sync_enrolments, enrol_cohort\task\enrol_cohort_sync, enrol_category\task\enrol_category_sync, core_course\task\course_delete_modules, block_rss_client\task\refreshfeeds, block_recent_activity\task\cleanup, auth_mnet\task\cron_task, auth_ldap\task\sync_task, auth_ldap\task\sync_roles, auth_db\task\sync_users, auth_cas\task\sync_task, tool_recyclebin\task\cleanup_course_bin, tool_recyclebin\task\cleanup_category_bin, tool_monitor\task\clean_events, tool_monitor\task\check_subscriptions, tool_monitor\notification_task, tool_messageinbound\task\pickup_task, tool_messageinbound\task\cleanup_task, logstore_standard\task\cleanup_task, logstore_legacy\task\cleanup_task, tool_langimport\task\update_langpacks_task, tool_dataprivacy\task\process_data_request_task, tool_dataprivacy\task\expired_retention_period, tool_dataprivacy\task\delete_expired_requests, tool_dataprivacy\task\delete_expired_contexts, tool_dataprivacy\task\delete_existing_deleted_users, tool_cohortroles\task\cohort_role_sync, tool_analytics\task\train_models, and tool_analytics\task\predict_models.
|
inherited |
Getter for $component.
string |
|
inherited |
Get the current lock for the entire cron.
core |
core\task\scheduled_task::get_day | ( | ) |
Getter for $day.
string |
core\task\scheduled_task::get_day_of_week | ( | ) |
Getter for $dayofweek.
string |
core\task\scheduled_task::get_disabled | ( | ) |
Getter for $disabled.
bool |
|
inherited |
Getter for $faildelay.
int |
core\task\scheduled_task::get_hour | ( | ) |
Getter for $hour.
string |
core\task\scheduled_task::get_last_run_time | ( | ) |
Get the last run time for this scheduled task.
int |
|
inherited |
Get the current lock for this task.
core |
core\task\scheduled_task::get_minute | ( | ) |
Getter for $minute.
string |
core\task\scheduled_task::get_month | ( | ) |
Getter for $month.
string |
|
abstract |
Get a descriptive name for this task (shown to admins).
string |
Reimplemented in repository_onedrive\remove_temp_access_task, repository_filesystem\task\cron_task, repository_dropbox\task\cron_task, qtype_random\task\remove_unused_questions, mod_workshop\task\legacy_workshop_allocation_cron, mod_workshop\task\cron_task, workshopallocation_scheduled\task\cron_task, mod_scorm\task\cron_task, quiz_statistics\task\quiz_statistics_cleanup, mod_quiz\task\update_overdue_attempts, mod_quiz\task\legacy_quiz_reports_cron, mod_quiz\task\legacy_quiz_accessrules_cron, ltiservice_gradebookservices\task\cleanup_task, mod_lti\task\clean_access_tokens, mod_forum\task\cron_task, mod_chat\task\cron_task, assignfeedback_editpdf\task\convert_submissions, mod_assign\task\cron_task, message_email\task\send_email_task, editor_atto\task\autosave_cleanup_task, core\task\task_log_cleanup_task, core\task\tag_cron_task, core\task\sync_plans_from_template_cohorts_task, core\task\stats_cron_task, core\task\session_cleanup_task, core\task\send_new_user_passwords_task, core\task\send_failed_login_notifications_task, core\task\search_optimize_task, core\task\search_index_task, core\task\registration_cron_task, core\task\question_stats_cleanup_task, core\task\question_preview_cleanup_task, core\task\portfolio_cron_task, core\task\plagiarism_cron_task, core\task\password_reset_cleanup_task, core\task\messaging_cleanup_task, core\task\legacy_plugin_cron_task, core\task\h5p_get_content_types_task, core\task\grade_history_cleanup_task, core\task\grade_cron_task, core\task\file_trash_cleanup_task, core\task\file_temp_cleanup_task, core\task\delete_unconfirmed_users_task, core\task\delete_incomplete_users_task, core\task\create_contexts_task, core\task\context_cleanup_task, core\task\completion_regular_task, core\task\completion_daily_task, core\task\complete_plans_task, core\task\check_for_updates_task, core\task\calendar_cron_task, core\task\cache_cron_task, core\task\cache_cleanup_task, core\task\blog_cron_task, core\task\badges_message_task, core\task\badges_cron_task, core\task\backup_cleanup_task, core\task\automated_backup_task, core\task\analytics_cleanup_task, core\oauth2\refresh_system_tokens_task, core_files\task\conversion_cleanup_task, enrol_self\task\sync_enrolments, enrol_self\task\send_expiry_notifications, enrol_paypal\task\process_expirations, enrol_meta\task\enrol_meta_sync, enrol_manual\task\sync_enrolments, enrol_manual\task\send_expiry_notifications, enrol_lti\task\sync_members, enrol_lti\task\sync_grades, enrol_ldap\task\sync_enrolments, enrol_imsenterprise\task\cron_task, enrol_flatfile\task\flatfile_sync_task, enrol_database\task\sync_enrolments, enrol_cohort\task\enrol_cohort_sync, enrol_category\task\enrol_category_sync, block_rss_client\task\refreshfeeds, block_recent_activity\task\cleanup, auth_mnet\task\cron_task, auth_ldap\task\sync_task, auth_ldap\task\sync_roles, auth_db\task\sync_users, auth_cas\task\sync_task, tool_recyclebin\task\cleanup_course_bin, tool_recyclebin\task\cleanup_category_bin, tool_monitor\task\clean_events, tool_monitor\task\check_subscriptions, tool_messageinbound\task\pickup_task, tool_messageinbound\task\cleanup_task, logstore_standard\task\cleanup_task, logstore_legacy\task\cleanup_task, tool_langimport\task\update_langpacks_task, tool_dataprivacy\task\expired_retention_period, tool_dataprivacy\task\delete_expired_requests, tool_dataprivacy\task\delete_expired_contexts, tool_dataprivacy\task\delete_existing_deleted_users, tool_cohortroles\task\cohort_role_sync, tool_analytics\task\train_models, and tool_analytics\task\predict_models.
|
inherited |
Get the next run time for this task.
int | timestamp |
core\task\scheduled_task::get_next_scheduled_time | ( | ) |
Calculate when this task should next be run based on the schedule.
int::$nextruntime,. |
core\task\scheduled_task::get_run_if_component_disabled | ( | ) |
Override this function if you want this scheduled task to run, even if the component is disabled.
bool |
|
inherited |
Getter for $blocking.
bool |
core\task\scheduled_task::is_customised | ( | ) |
Has this task been changed from it's default config?
bool |
|
inherited |
Setter for $blocking.
bool | $blocking |
|
inherited |
Setter for $component.
string | $component |
|
inherited |
Set the current lock for the entire cron process.
core\lock\lock | $lock |
core\task\scheduled_task::set_customised | ( | $customised | ) |
Has this task been changed from it's default config?
bool |
core\task\scheduled_task::set_day | ( | $day | ) |
Setter for $day.
string | $day |
core\task\scheduled_task::set_day_of_week | ( | $dayofweek | ) |
Setter for $dayofweek.
string | $dayofweek |
core\task\scheduled_task::set_disabled | ( | $disabled | ) |
Setter for $disabled.
bool | $disabled |
|
inherited |
Setter for $faildelay.
int | $faildelay |
core\task\scheduled_task::set_hour | ( | $hour | ) |
Setter for $hour.
Accepts a special 'R' value which will be translated to a random hour.
string | $hour |
core\task\scheduled_task::set_last_run_time | ( | $lastruntime | ) |
Set the last run time for this scheduled task.
int | $lastruntime |
|
inherited |
Set the current lock for this task.
core\lock\lock | $lock |
core\task\scheduled_task::set_minute | ( | $minute | ) |
Setter for $minute.
Accepts a special 'R' value which will be translated to a random minute.
string | $minute |
core\task\scheduled_task::set_month | ( | $month | ) |
Setter for $month.
string | $month |
|
inherited |
Set the next run time for this task.
int | $nextruntime |