UserImport
class UserImport extends Import
Properties
protected string | $path | Path to the directory with the import files. |
from Import |
protected Collection|null | $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
in
Import at line 23
__construct(string $path)
Create a new instance.
in
Import at line 33
bool
filesMatch()
Check if this import matches to the given import files.
in
Import at line 48
validateFiles()
Check if the files of this import are valid.
at line 96
protected array
expectedFiles()
The files expected by this import.
in
Import at line 70
protected array
files()
Get the basename of each file of this import.
at line 104
protected
validateFile(string $basename)
Validate a file of this import.
in
Import at line 96
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.
in
Import at line 122
protected
expectColumnsInCsv(string $file, array $expectation)
Validates a CSV file to contain the expected columns.
in
Import at line 146
protected Collection
collectJson(string $file)
Read a JSON file containing an array and wrap it in a Laravel collection.
at line 26
array
perform(array $only = null)
Perform the import.
at line 70
Collection
getImportUsers()
Get the contents of the user import file.
at line 84
Collection
getUserImportCandidates()
Get users that can be imported.
at line 126
protected Collection
getConflicts()
Get import users whose email address matches with an existing user but the UUID doesn't.