fix: [Command] typo fixed as mentioned in #71
parent
e32dae2498
commit
739dc25b1e
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generic importer to feed data to cerebrate from JSON or CSV.
|
* Generic importer to feed data to cerebrate from JSON or CSV.
|
||||||
*
|
*
|
||||||
* - JSON configuration file must have the `format` key which can either take the value `json` or `csv`
|
* - JSON configuration file must have the `format` key which can either take the value `json` or `csv`
|
||||||
* - If `csv` is provided, the file must contains the header.
|
* - If `csv` is provided, the file must contains the header.
|
||||||
* - If `json` is provided, a `mapping` key on how to reach each fields using the cakephp4's Hash syntax must be provided.
|
* - If `json` is provided, a `mapping` key on how to reach each fields using the cakephp4's Hash syntax must be provided.
|
||||||
|
@ -10,7 +10,7 @@
|
||||||
* - The key is the field name
|
* - The key is the field name
|
||||||
* - The value
|
* - The value
|
||||||
* - Can either be the string representing the path from which to get the value
|
* - Can either be the string representing the path from which to get the value
|
||||||
* - Or a JSON containg the `path`, the optional `override` parameter specifying if the existing data should be overriden
|
* - Or a JSON containg the `path`, the optional `override` parameter specifying if the existing data should be overriden
|
||||||
* and an optional `massage` function able to alter the data.
|
* and an optional `massage` function able to alter the data.
|
||||||
* - Example
|
* - Example
|
||||||
* {
|
* {
|
||||||
|
@ -22,7 +22,7 @@
|
||||||
* },
|
* },
|
||||||
*
|
*
|
||||||
* - The optional primary key argument provides a way to make import replayable. It can typically be used when an ID or UUID is not provided in the source file but can be replaced by something else (e.g. team-name or other type of unique data).
|
* - The optional primary key argument provides a way to make import replayable. It can typically be used when an ID or UUID is not provided in the source file but can be replaced by something else (e.g. team-name or other type of unique data).
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace App\Command;
|
namespace App\Command;
|
||||||
|
@ -161,7 +161,7 @@ class ImporterCommand extends Command
|
||||||
'valueField' => 'id'
|
'valueField' => 'id'
|
||||||
])->where(['meta_template_id' => $metaTemplate->id])->toArray();
|
])->where(['meta_template_id' => $metaTemplate->id])->toArray();
|
||||||
} else {
|
} else {
|
||||||
$this->io->error("Unkown template for UUID {$config['metaTemplateUUID']}");
|
$this->io->error("Unknown template for UUID {$config['metaTemplateUUID']}");
|
||||||
die(1);
|
die(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -192,7 +192,7 @@ class ImporterCommand extends Command
|
||||||
$metaEntity->meta_template_field_id = $metaTemplateFieldsMapping[$fieldName];
|
$metaEntity->meta_template_field_id = $metaTemplateFieldsMapping[$fieldName];
|
||||||
} else {
|
} else {
|
||||||
$hasErrors = true;
|
$hasErrors = true;
|
||||||
$this->io->error("Field $fieldName is unkown for template {$metaTemplate->name}");
|
$this->io->error("Field $fieldName is unknown for template {$metaTemplate->name}");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -525,4 +525,4 @@ class ImporterCommand extends Command
|
||||||
{
|
{
|
||||||
return is_null($value) ? '' : $value;
|
return is_null($value) ? '' : $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue