Skip to content

Commit

Permalink
Convert timestamps to string and deserialize arrays in the export file
Browse files Browse the repository at this point in the history
  • Loading branch information
coastforge-rro committed Dec 4, 2019
1 parent 7350ebd commit 28d3517
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Classes/Listener/ExportLoadDataListener.php
Expand Up @@ -124,6 +124,17 @@ public function onExportLoadExecuteQuery(
$result = $statement->fetchAll();

if (count($result) >= 1) {

foreach ($result as $key => $row) {
foreach ($row as $k => $value) {
if (strlen(strval(intval($value))) === 10) {
$result[$key][$k] = date('d.m.Y', $value);
} elseif (is_array(StringUtil::deserialize($value)) === true && !empty(StringUtil::deserialize($value))) {
$result[$key][$k] = implode(', ', StringUtil::deserialize($value));
}
}
}

$event->setResult($result);
}
}
Expand Down

0 comments on commit 28d3517

Please sign in to comment.