public static function get_adhoc_tasks($classname) {
        global $DB;

        $classname = self::get_canonical_class_name($classname);
        // We are just reading - so no locks required.
        $records = $DB->get_records('task_adhoc', array('classname' => $classname));

        return array_map(function($record) {
            return self::adhoc_task_from_record($record);
        }, $records);
    }
public static function get_adhoc_tasks($classname) {
        global $DB;

        $classname = self::get_canonical_class_name($classname);
        // We are just reading - so no locks required.
        $records = $DB->get_records('task_adhoc', array('classname' => $classname));

        return array_map(function($record) {
            return self::adhoc_task_from_record($record);
        }, $records);
    }
public static function get_adhoc_tasks ( $ classname ) { global $ DB ; $ classname = self :: get_canonical_class_name ( $ classname ) ; // We are just reading - so no locks required. $ records = $ DB -> get_records ( 'task_adhoc' , array ( 'classname' => $ classname ) ) ; return array_map ( function ( $ record ) { return self :: adhoc_task_from_record ( $ record ) ; } , $ records ) ; }
This function load the adhoc tasks for a given classname.

@param string $classname
@return \core\task\adhoc_task[]
This function load the adhoc tasks for a given classname .