public function importMigrationFiles()
{
if ($this->getError()) {
return $this;
}
foreach ($this->files as $file) {
// Read the file data in
if (!$file['handler']->readFile()) {
continue;
}
// Get the file name
$filename = (string) $file['file'];
// Our import arrays should be indexed, if not we have a problem
if (!Arr::isIndexedArray($this->data)) {
$this->setError(true)->setErrorMessage("File '{$filename}' has an invalid import format!");
continue;
}
// Import the records from the given file
$this->importRecords($filename);
}
return $this;
}