mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-01-13 13:49:33 +00:00
Assemblies einführen
This commit is contained in:
parent
c79fc47c1e
commit
55828d830d
45 changed files with 2754 additions and 127 deletions
|
|
@ -76,8 +76,6 @@ class BOMImporter
|
|||
|
||||
private DBElementRepository $assemblyBOMEntryRepository;
|
||||
|
||||
private TranslatorInterface $translator;
|
||||
|
||||
public function __construct(
|
||||
private readonly EntityManagerInterface $entityManager,
|
||||
private readonly TranslatorInterface $translator,
|
||||
|
|
@ -89,7 +87,6 @@ class BOMImporter
|
|||
$this->categoryRepository = $entityManager->getRepository(Category::class);
|
||||
$this->projectBOMEntryRepository = $entityManager->getRepository(ProjectBOMEntry::class);
|
||||
$this->assemblyBOMEntryRepository = $entityManager->getRepository(AssemblyBOMEntry::class);
|
||||
$this->translator = $translator;
|
||||
}
|
||||
|
||||
protected function configureOptions(OptionsResolver $resolver): OptionsResolver
|
||||
|
|
@ -257,7 +254,8 @@ class BOMImporter
|
|||
$options = $resolver->resolve($options);
|
||||
|
||||
return match ($options['type']) {
|
||||
self::IMPORT_TYPE_KICAD_PCB => $this->parseKiCADPCB($data, $objectType)->getBomEntries(),
|
||||
self::IMPORT_TYPE_KICAD_PCB => $this->parseKiCADPCB($data, $importObject)->getBomEntries(),
|
||||
self::IMPORT_TYPE_KICAD_SCHEMATIC => $this->parseKiCADPCB($data, $importObject)->getBomEntries(),
|
||||
default => throw new InvalidArgumentException($this->translator->trans('validator.bom_importer.invalid_import_type', [], 'validators')),
|
||||
};
|
||||
}
|
||||
|
|
@ -285,8 +283,8 @@ class BOMImporter
|
|||
|
||||
return match ($options['type']) {
|
||||
self::IMPORT_TYPE_KICAD_PCB => $this->parseKiCADPCB($data, $importObject),
|
||||
self::IMPORT_TYPE_JSON => $this->parseJson($data, $importObject),
|
||||
self::IMPORT_TYPE_CSV => $this->parseCsv($data, $importObject),
|
||||
self::IMPORT_TYPE_JSON => $this->parseJson($importObject, $data),
|
||||
self::IMPORT_TYPE_CSV => $this->parseCsv($importObject, $data),
|
||||
default => $defaultImporterResult,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue