mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-05 14:59:36 +00:00
Typdefinitionen in BOMImporter anpassen
This commit is contained in:
parent
4b6018fe86
commit
5b95513955
2 changed files with 8 additions and 8 deletions
|
|
@ -243,13 +243,13 @@ class BOMImporter
|
||||||
/**
|
/**
|
||||||
* Import string data into an array of BOM entries, which are not yet assigned to a project.
|
* Import string data into an array of BOM entries, which are not yet assigned to a project.
|
||||||
*
|
*
|
||||||
* @param Project|Assembly $importObject The object determining the context of the BOM entry (either a Project or Assembly).
|
* @param object $importObject The object determining the context of the BOM entry (either a Project or Assembly).
|
||||||
* @param string $data The data to import
|
* @param string $data The data to import
|
||||||
* @param array $options An array of options
|
* @param array $options An array of options
|
||||||
*
|
*
|
||||||
* @return ProjectBOMEntry[]|AssemblyBOMEntry[] An array of imported entries
|
* @return ProjectBOMEntry[]|AssemblyBOMEntry[]|object[] An array of imported entries
|
||||||
*/
|
*/
|
||||||
public function stringToBOMEntries(Project|Assembly $importObject, string $data, array $options): array
|
public function stringToBOMEntries(object $importObject, string $data, array $options): array
|
||||||
{
|
{
|
||||||
$resolver = new OptionsResolver();
|
$resolver = new OptionsResolver();
|
||||||
$resolver = $this->configureOptions($resolver);
|
$resolver = $this->configureOptions($resolver);
|
||||||
|
|
@ -299,12 +299,12 @@ class BOMImporter
|
||||||
* The BOM entries are added to the provided Project or Assembly, depending on the context.
|
* The BOM entries are added to the provided Project or Assembly, depending on the context.
|
||||||
*
|
*
|
||||||
* @param string $data The semicolon- or comma-delimited CSV data to be parsed.
|
* @param string $data The semicolon- or comma-delimited CSV data to be parsed.
|
||||||
* @param Project|Assembly $importObject The object determining the context of the BOM entry (either a Project or Assembly).
|
* @param object $importObject The object determining the context of the BOM entry (either a Project or Assembly).
|
||||||
* @return ImporterResult The result of the import process, containing the created BOM entries.
|
* @return ImporterResult The result of the import process, containing the created BOM entries.
|
||||||
*
|
*
|
||||||
* @throws UnexpectedValueException If required fields are missing in the provided data.
|
* @throws UnexpectedValueException If required fields are missing in the provided data.
|
||||||
*/
|
*/
|
||||||
private function parseKiCADPCB(string $data, Project|Assembly $importObject): ImporterResult
|
private function parseKiCADPCB(string $data, object $importObject): ImporterResult
|
||||||
{
|
{
|
||||||
$result = new ImporterResult();
|
$result = new ImporterResult();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -788,7 +788,7 @@ final class BOMImporterTest extends WebTestCase
|
||||||
'Quantity' => 'Quantity'
|
'Quantity' => 'Quantity'
|
||||||
];
|
];
|
||||||
|
|
||||||
$bom_entries = $this->service->stringToBOMEntries($input, [
|
$bom_entries = $this->service->stringToBOMEntries($lcscSupplier, $input, [
|
||||||
'type' => 'kicad_schematic',
|
'type' => 'kicad_schematic',
|
||||||
'field_mapping' => $field_mapping,
|
'field_mapping' => $field_mapping,
|
||||||
'delimiter' => ','
|
'delimiter' => ','
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue