Added an simple import system for attachment types.

This commit is contained in:
Jan Böhmer 2019-04-11 22:41:21 +02:00
parent b827737caa
commit 68aa750e00
7 changed files with 297 additions and 6 deletions

View file

@ -96,7 +96,14 @@ class EntityExporter
break;
}
$response = new Response($this->serializer->serialize($entity, $format,
//Ensure that we always serialize an array. This makes it easier to import the data again.
if(is_array($entity)) {
$entity_array = $entity;
} else {
$entity_array = [$entity];
}
$response = new Response($this->serializer->serialize($entity_array, $format,
[
'groups' => $groups,
'as_collection' => true,