Skip to content

Commit e2d6022

Browse files
committed
Merge branch 'main' of github.com:cerebrate-project/cerebrate into main
2 parents 5a7f7df + 739dc25 commit e2d6022

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Command/ImporterCommand.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
/**
44
* Generic importer to feed data to cerebrate from JSON or CSV.
5-
*
5+
*
66
* - JSON configuration file must have the `format` key which can either take the value `json` or `csv`
77
* - If `csv` is provided, the file must contains the header.
88
* - If `json` is provided, a `mapping` key on how to reach each fields using the cakephp4's Hash syntax must be provided.
99
* - The mapping is done in the following way:
1010
* - The key is the field name
1111
* - The value
1212
* - Can either be the string representing the path from which to get the value
13-
* - Or a JSON containg the `path`, the optional `override` parameter specifying if the existing data should be overriden
13+
* - Or a JSON containg the `path`, the optional `override` parameter specifying if the existing data should be overriden
1414
* and an optional `massage` function able to alter the data.
1515
* - Example
1616
* {
@@ -22,7 +22,7 @@
2222
* },
2323
*
2424
* - 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).
25-
*
25+
*
2626
*/
2727

2828
namespace App\Command;
@@ -165,7 +165,7 @@ private function marshalData($table, $data, $config, $primary_key=null)
165165
'valueField' => 'id'
166166
])->where(['meta_template_id' => $metaTemplate->id])->toArray();
167167
} else {
168-
$this->io->error("Unkown template for UUID {$config['metaTemplateUUID']}");
168+
$this->io->error("Unknown template for UUID {$config['metaTemplateUUID']}");
169169
die(1);
170170
}
171171
}
@@ -196,7 +196,7 @@ private function marshalData($table, $data, $config, $primary_key=null)
196196
$metaEntity->meta_template_field_id = $metaTemplateFieldsMapping[$fieldName];
197197
} else {
198198
$hasErrors = true;
199-
$this->io->error("Field $fieldName is unkown for template {$metaTemplate->name}");
199+
$this->io->error("Field $fieldName is unknown for template {$metaTemplate->name}");
200200
break;
201201
}
202202
}
@@ -529,4 +529,4 @@ private function nullToEmptyString($value)
529529
{
530530
return is_null($value) ? '' : $value;
531531
}
532-
}
532+
}

0 commit comments

Comments
 (0)