MDL-75256 task: move abstract get_name method to base class.
Allow adhoc tasks to implement this method, so they too can have descriptive names for themselves. Default implementation added to return the class name itself.
This commit is contained in:
@@ -62,6 +62,13 @@ abstract class task_base {
|
||||
/** @var int $pid - PHP process ID that is running the task */
|
||||
private $pid = null;
|
||||
|
||||
/**
|
||||
* Get a descriptive name for the task (shown to admins)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
abstract public function get_name();
|
||||
|
||||
/**
|
||||
* Set the current lock for this task.
|
||||
* @param \core\lock\lock $lock
|
||||
|
||||
Reference in New Issue
Block a user