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:
Paul Holden
2022-07-22 09:13:53 +01:00
parent 4ce642e8ba
commit d0b5241786
9 changed files with 67 additions and 13 deletions
+7
View File
@@ -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