Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

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

Class process

Copyright: 2020 Moodle
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 1409 lines (62 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_match_on_email()   X-Ref
Setting to allow matching user accounts on email

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