original_string: public static function load_scheduled_tasks_for_component($componentname) {
          global $DB;
  
          $tasks = array();
          // We are just reading - so no locks required.
          $records = $DB->get_records('task_scheduled', array('component' => $componentname), 'classname', '*', IGNORE_MISSING);
          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;
      }
code: public static function load_scheduled_tasks_for_component($componentname) {
          global $DB;
  
          $tasks = array();
          // We are just reading - so no locks required.
          $records = $DB->get_records('task_scheduled', array('component' => $componentname), 'classname', '*', IGNORE_MISSING);
          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;
      }
code_tokens: public static function load_scheduled_tasks_for_component ( $ componentname ) { global $ DB ; $ tasks = array ( ) ; // We are just reading - so no locks required. $ records = $ DB -> get_records ( 'task_scheduled' , array ( 'component' => $ componentname ) , 'classname' , '*' , IGNORE_MISSING ) ; 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 ; }
docstring: Given a component name, will load the list of tasks from the scheduled_tasks table for that component.
  Do not execute tasks loaded from this function - they have not been locked.
  @param string $componentname - The name of the component to load the tasks for.
  @return \core\task\scheduled_task[]
docstring_tokens: Given a component name will load the list of tasks from the scheduled_tasks table for that component . Do not execute tasks loaded from this function - they have not been locked .