public static function get_all_scheduled_tasks() {
        global $DB;

        $records = $DB->get_records('task_scheduled', null, 'component, classname', '*', IGNORE_MISSING);
        $tasks = array();

        foreach ($records as $record) {
            $task = self::scheduled_task_from_record($record);
            // Safety check in case the task in the DB does not match a real class (maybe something was uninstalled).
            if ($task) {
                $tasks[] = $task;
            }
        }

        return $tasks;
    }
public static function get_all_scheduled_tasks() {
        global $DB;

        $records = $DB->get_records('task_scheduled', null, 'component, classname', '*', IGNORE_MISSING);
        $tasks = array();

        foreach ($records as $record) {
            $task = self::scheduled_task_from_record($record);
            // Safety check in case the task in the DB does not match a real class (maybe something was uninstalled).
            if ($task) {
                $tasks[] = $task;
            }
        }

        return $tasks;
    }
public static function get_all_scheduled_tasks ( ) { global $ DB ; $ records = $ DB -> get_records ( 'task_scheduled' , null , 'component, classname' , '*' , IGNORE_MISSING ) ; $ tasks = array ( ) ; foreach ( $ records as $ record ) { $ task = self :: scheduled_task_from_record ( $ record ) ; // Safety check in case the task in the DB does not match a real class (maybe something was uninstalled). if ( $ task ) { $ tasks [ ] = $ task ; } } return $ tasks ; }
This function will return a list of all the scheduled tasks that exist in the database.

@return \core\task\scheduled_task[]
This function will return a list of all the scheduled tasks that exist in the database .