UserImport
class UserImport extendsImport
Properties
protectedstring | $path | Path to the directory with the import files. | from Import |
protectedCollection | $importUsers | Caches the decoded user import file. |
Methods
The files expected by this import.
Validate a file of this import.
Validates a JSON file to contain an array of objects, each of which has all the expected keys.
Validates a CSV file to contain the expected columns.
Read a JSON file containing an array and wrap it in a Laravel collection.
Perform the import.
Get the contents of the user import file.
Get users that can be imported.
Get import users whose email address matches with an existing user but the UUID doesn't.
Details
inImportat line23
__construct(string$path)
Create a new instance.
inImportat line33
bool
filesMatch()
Check if this import matches to the given import files.
inImportat line48
validateFiles()
Check if the files of this import are valid.
at line99
protectedarray
expectedFiles()
The files expected by this import.
inImportat line70
protectedarray
files()
Get the basename of each file of this import.
at line107
protected
validateFile(string$basename)
Validate a file of this import.
inImportat line98
protected
expectKeysInJson(string$file,array$expectation,bool$array =true)
Validates a JSON file to contain an array of objects, each of which has all the expected keys.
inImportat line124
protected
expectColumnsInCsv(string$file,array$expectation)
Validates a CSV file to contain the expected columns.
inImportat line148
protectedCollection
collectJson(string$file)
Read a JSON file containing an array and wrap it in a Laravel collection.
at line26
array
perform(array$only =null)
Perform the import.
at line73
Collection
getImportUsers()
Get the contents of the user import file.
at line87
Collection
getUserImportCandidates()
Get users that can be imported.
at line129
protectedCollection
getConflicts()
Get import users whose email address matches with an existing user but the UUID doesn't.