PublicLabelTreeImport
class PublicLabelTreeImport extendsImport
Properties
protectedstring | $path | Path to the directory with the import files. | from Import |
protectedCollection | $importLabelTree | Caches the decoded label tree 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.
Checks if the label tree of the import already exists.
Get the contents of the label tree import file.
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 line70
protectedarray
expectedFiles()
The files expected by this import.
inImportat line70
protectedarray
files()
Get the basename of each file of this import.
at line81
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 line25
perform()
Perform the import.
at line46
bool
treeExists()
Checks if the label tree of the import already exists.
at line58
protectedCollection
getImportLabelTree()
Get the contents of the label tree import file.
at line110
protected
importLabels(LabelTree$tree)
Import the labels of this import.