chg: [command] Generic import tool allow passing path directly

pull/35/head
mokaddem 2020-11-27 16:48:14 +01:00
parent 0c14d30ae7
commit 35ba595a82
1 changed files with 3 additions and 0 deletions

View File

@ -133,6 +133,9 @@ class ImporterCommand extends Command
$data = [];
foreach ($config as $key => $fieldConfig) {
$values = null;
if (!is_array($fieldConfig)) {
$fieldConfig = ['path' => $fieldConfig];
}
if (!empty($fieldConfig['path'])) {
$values = Hash::extract($source, $fieldConfig['path']);
}