* Replace importer with AJAX powered; better error handling #443 * Formatting * Fix command line importer
This commit is contained in:
@@ -5,21 +5,17 @@ namespace Modules\Installer\Services\Importer\Importers;
|
||||
use App\Models\Aircraft;
|
||||
use App\Models\Airline;
|
||||
use App\Models\Subfleet;
|
||||
use Modules\Installer\Exceptions\ImporterNoMoreRecords;
|
||||
use Modules\Installer\Services\Importer\BaseImporter;
|
||||
|
||||
class AircraftImporter extends BaseImporter
|
||||
{
|
||||
public $table = 'aircraft';
|
||||
|
||||
/**
|
||||
* CONSTANTS
|
||||
*/
|
||||
public const SUBFLEET_NAME = 'Imported Aircraft';
|
||||
|
||||
/**
|
||||
* @param int $start
|
||||
*
|
||||
* @throws \Modules\Installer\Exceptions\ImporterNoMoreRecords
|
||||
*/
|
||||
public function run($start = 0)
|
||||
{
|
||||
$this->comment('--- AIRCRAFT IMPORT ---');
|
||||
@@ -29,7 +25,7 @@ class AircraftImporter extends BaseImporter
|
||||
$this->info('Subfleet ID is '.$subfleet->id);
|
||||
|
||||
$count = 0;
|
||||
foreach ($this->db->readRows('aircraft') as $row) {
|
||||
foreach ($this->db->readRows($this->table, $start) as $row) {
|
||||
$where = [
|
||||
'name' => $row->fullname,
|
||||
'registration' => $row->registration,
|
||||
@@ -49,8 +45,6 @@ class AircraftImporter extends BaseImporter
|
||||
}
|
||||
|
||||
$this->info('Imported '.$count.' aircraft');
|
||||
|
||||
throw new ImporterNoMoreRecords();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user