original_string: public static function preload_custom_fields(array &$records) {
          $customfields = \core_course\customfield\course_handler::create()->get_instances_data(array_keys($records));
          foreach ($customfields as $courseid => $data) {
              $records[$courseid]->customfields = $data;
          }
      }
code: public static function preload_custom_fields(array &$records) {
          $customfields = \core_course\customfield\course_handler::create()->get_instances_data(array_keys($records));
          foreach ($customfields as $courseid => $data) {
              $records[$courseid]->customfields = $data;
          }
      }
code_tokens: public static function preload_custom_fields ( array & $ records ) { $ customfields = \ core_course \ customfield \ course_handler :: create ( ) -> get_instances_data ( array_keys ( $ records ) ) ; foreach ( $ customfields as $ courseid => $ data ) { $ records [ $ courseid ] -> customfields = $ data ; } }
docstring: Preloads the custom fields values in bulk
  
  @param array $records
docstring_tokens: Preloads the custom fields values in bulk