Allow to import category, footprint and manufacturer by giving a string in the CSV file

This commit is contained in:
Jan Böhmer 2023-03-12 21:10:48 +01:00
parent 85ae862381
commit 61e2dde400
12 changed files with 173 additions and 35 deletions

View file

@ -21,6 +21,7 @@
namespace App\Serializer;
use App\Entity\Base\AbstractStructuralDBElement;
use Symfony\Component\Serializer\Normalizer\ContextAwareDenormalizerInterface;
use Symfony\Component\Serializer\Normalizer\ContextAwareNormalizerInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
@ -48,7 +49,7 @@ class StructuralElementNormalizer implements ContextAwareNormalizerInterface
$data = $this->normalizer->normalize($object, $format, $context);
//Remove type field for CSV export
if ($format == 'csv') {
if ($format === 'csv') {
unset($data['type']);
}