diff --git a/src/Command/ImporterCommand.php b/src/Command/ImporterCommand.php index c79ba76..ecbf6ac 100644 --- a/src/Command/ImporterCommand.php +++ b/src/Command/ImporterCommand.php @@ -128,7 +128,9 @@ class ImporterCommand extends Command $this->loadModel('MetaFields'); $entities = []; if (is_null($primary_key)) { - $entities = $table->newEntities($data); + $entities = $table->newEntities($data, [ + 'accessibleFields' => ($table->newEmptyEntity())->getAccessibleFieldForNew() + ]); } else { foreach ($data as $i => $item) { $entity = null; @@ -145,7 +147,9 @@ class ImporterCommand extends Command $this->lockAccess($entity); } if (!is_null($entity)) { - $entity = $table->patchEntity($entity, $item); + $entity = $table->patchEntity($entity, $item, [ + 'accessibleFields' => $entity->getAccessibleFieldForNew() + ]); $entities[] = $entity; } } diff --git a/src/Command/config/config-misp-format-organisation.json b/src/Command/config/config-misp-format-organisation.json new file mode 100644 index 0000000..7e591c0 --- /dev/null +++ b/src/Command/config/config-misp-format-organisation.json @@ -0,0 +1,11 @@ +{ + "format": "json", + "mapping": { + "name": "{n}.Organisation.name", + "uuid": "{n}.Organisation.uuid", + "nationality": "{n}.Organisation.nationality" + }, + "sourceHeaders": { + "Authorization": "~~YOUR_API_KEY_HERE~~" + } +} \ No newline at end of file