Updated export routine.

This commit is contained in:
James Cole
2017-08-18 14:45:42 +02:00
parent 6666d1a2f4
commit b955486f14
11 changed files with 482 additions and 139 deletions

View File

@@ -58,8 +58,12 @@ class CsvExporter extends BasicExporter implements ExporterInterface
// get field names for header row:
$first = $this->getEntries()->first();
$headers = array_keys(get_object_vars($first));
$rows[] = $headers;
$headers = [];
if (!is_null($first)) {
$headers = array_keys(get_object_vars($first));
}
$rows[] = $headers;
/** @var Entry $entry */
foreach ($this->getEntries() as $entry) {