Ensure proper types when saving import log

Insertion is stored as integer in database.
Therefore cast boolean to integer.
Otherwise DataHandler might throw error as saved data type differs from
provided data type.
This commit is contained in:
Daniel Siepmann 2021-02-15 16:04:59 +01:00
parent b8b0c4f668
commit dc5a4546f3

View file

@ -56,7 +56,7 @@ class ImportLogRepository extends Repository
$dataHandler = clone $this->dataHandler;
$dataHandler->start([
'tx_thuecat_import_log' => [
'NEW0' => [
'NEW0' => [
'pid' => 0,
'configuration' => $log->getConfiguration()->getUid(),
],
@ -77,7 +77,7 @@ class ImportLogRepository extends Repository
$entries['NEW' . $number] = [
'pid' => 0,
'import_log' => 'NEW0',
'insertion' => $entry->wasInsertion(),
'insertion' => (int) $entry->wasInsertion(),
'record_uid' => $entry->getRecordUid(),
'table_name' => $entry->getRecordDatabaseTableName(),
'errors' => json_encode($entry->getErrors()),