Subfleet exporter #194

This commit is contained in:
Nabeel Shahzad
2018-03-22 17:59:10 -05:00
parent 46d8fb125a
commit 112a72ac6f
8 changed files with 156 additions and 15 deletions

View File

@@ -9,6 +9,7 @@ use App\Services\ImportExport\AirportExporter;
use App\Services\ImportExport\ExpenseExporter;
use App\Services\ImportExport\FareExporter;
use App\Services\ImportExport\FlightExporter;
use App\Services\ImportExport\SubfleetExporter;
use Illuminate\Support\Collection;
use League\Csv\CharsetConverter;
use League\Csv\Writer;
@@ -121,4 +122,16 @@ class ExportService extends Service
$exporter = new FlightExporter();
return $this->runExport($flights, $exporter);
}
/**
* Export all of the flights
* @param Collection $subfleets
* @return mixed
* @throws \League\Csv\CannotInsertRecord
*/
public function exportSubfleets($subfleets)
{
$exporter = new SubfleetExporter();
return $this->runExport($subfleets, $exporter);
}
}