Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 310 and 311] [Versions 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403]

Class process

Copyright: 2020 Moodle
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 1329 lines (58 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 2 classes


Class: process  - X-Ref

Process CSV file with users data, this will create/update users, enrol them into courses, etc

__construct(\csv_import_reader $cir, string $progresstrackerclass = null)   X-Ref
process constructor.

param: \csv_import_reader $cir
param: string|null $progresstrackerclass

Class: must  - X-Ref

find_standard_fields()   X-Ref
Standard user fields.


find_profile_fields()   X-Ref
Profile fields


get_file_columns()   X-Ref
Returns the list of columns in the file

return: array

set_form_data(\stdClass $formdata)   X-Ref
Set data from the form (or from CLI options)

param: \stdClass $formdata

get_operation_type()   X-Ref
Operation type

return: int

get_allow_deletes()   X-Ref
Setting to allow deletes

return: bool

get_allow_renames()   X-Ref
Setting to allow deletes

return: bool

get_bulk()   X-Ref
Setting to select for bulk actions (not available in CLI)

return: bool

get_update_type()   X-Ref
Setting for update type

return: int

get_update_passwords()   X-Ref
Setting to allow update passwords

return: bool

get_allow_email_duplicates()   X-Ref
Setting to allow email duplicates

return: bool

get_reset_passwords()   X-Ref
Setting for reset password

return: int UU_PWRESET_NONE, UU_PWRESET_WEAK, UU_PWRESET_ALL

get_create_paswords()   X-Ref
Setting to allow create passwords

return: bool

get_allow_suspends()   X-Ref
Setting to allow suspends

return: bool

get_normalise_user_names()   X-Ref
Setting to normalise user names

return: bool

get_string_yes_no($value)   X-Ref
Helper method to return Yes/No string

param: bool $value
return: string

process()   X-Ref
Process the CSV file


prepare_user_record(array $line)   X-Ref
Prepare one line from CSV file as a user record

param: array $line
return: \stdClass|null

process_line(array $line)   X-Ref
Process one line from CSV file

param: array $line

get_stats()   X-Ref
Summary about the whole process (how many users created, skipped, updated, etc)

return: array