Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 310 and 400] [Versions 311 and 400] [Versions 39 and 400] [Versions 400 and 401] [Versions 400 and 402] [Versions 400 and 403]

Abstract class for common properties of scheduled_task and adhoc_task.

Copyright: 2013 Damyon Wiese
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 253 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 2 classes

task_base:: (10 methods):
  set_lock()
  set_cron_lock()
  get_lock()
  get_next_run_time()
  set_next_run_time()
  get_cron_lock()
  set_blocking()
  is_blocking()
  set_component()
  get_component()

namespace:: (9 methods):
  set_fail_delay()
  get_fail_delay()
  set_timestarted()
  get_timestarted()
  set_hostname()
  get_hostname()
  set_pid()
  get_pid()
  is_component_enabled()


Class: task_base  - X-Ref

Abstract class for common properties of scheduled_task and adhoc_task.

set_lock(\core\lock\lock $lock)   X-Ref
Set the current lock for this task.

param: \core\lock\lock $lock

set_cron_lock(\core\lock\lock $lock)   X-Ref
Set the current lock for the entire cron process.

param: \core\lock\lock $lock

get_lock()   X-Ref
Get the current lock for this task.

return: \core\lock\lock

get_next_run_time()   X-Ref
Get the next run time for this task.

return: int timestamp

set_next_run_time($nextruntime)   X-Ref
Set the next run time for this task.

param: int $nextruntime

get_cron_lock()   X-Ref
Get the current lock for the entire cron.

return: \core\lock\lock

set_blocking($blocking)   X-Ref
Setter for $blocking.

param: bool $blocking

is_blocking()   X-Ref
Getter for $blocking.

return: bool

set_component($component)   X-Ref
Setter for $component.

param: string $component

get_component()   X-Ref
Getter for $component.

return: string

Class: namespace  - X-Ref

set_fail_delay($faildelay)   X-Ref
Setter for $faildelay.

param: int $faildelay

get_fail_delay()   X-Ref
Getter for $faildelay.

return: int

set_timestarted($timestarted = null)   X-Ref
Setter for $timestarted.

param: int $timestarted

get_timestarted()   X-Ref
Getter for $timestarted.

return: int

set_hostname($hostname = null)   X-Ref
Setter for $hostname.

param: string $hostname

get_hostname()   X-Ref
Getter for $hostname.

return: string

set_pid($pid = null)   X-Ref
Setter for $pid.

param: int $pid

get_pid()   X-Ref
Getter for $pid.

return: int

is_component_enabled()   X-Ref
Informs whether the task's component is enabled.

return: bool true when enabled. false otherwise.