diff --git a/cobertura.xml b/cobertura.xml index c593e50..206d7ea 100644 --- a/cobertura.xml +++ b/cobertura.xml @@ -1,6 +1,6 @@ - + /home/thomas/projekte/calc/src @@ -5976,9 +5976,9 @@ - + - + @@ -6048,14 +6048,14 @@ - + - - - - + + + + @@ -6064,82 +6064,96 @@ - + - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + - - - + + + + + + + + + + + + + + + + + + + - + - - - - + + + + - - - - + + + + - + - + - + - + @@ -6194,10 +6208,10 @@ - - - - + + + + @@ -6206,46 +6220,60 @@ - + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -7784,7 +7812,7 @@ - + @@ -7876,7 +7904,7 @@ - + diff --git a/src/Option/Parser/Select.php b/src/Option/Parser/Select.php index accdb31..53e8280 100644 --- a/src/Option/Parser/Select.php +++ b/src/Option/Parser/Select.php @@ -122,6 +122,7 @@ class Select extends Base private function parseModePapierDbXML() { + $this->element->setContainer((string) $this->node['container']); if ($this->getPaperRepository()) { $this->element->setNewPaperObject($this->getPaperRepository()->getNewObject()); /** @var PaperContainer\Container $container */ @@ -144,14 +145,35 @@ class Select extends Base } } } - } else { - $this->element->setContainer((string) $this->node['container']); } } private function parseModePapierDbJson() { $this->element->setContainer((string) $this->json['container']); + if ($this->getPaperRepository()) { + $this->element->setNewPaperObject($this->getPaperRepository()->getNewObject()); + /** @var PaperContainer\Container $container */ + $container = $this->getPaperContainer()->getContainerById((string) $this->json['container']); + + if ($container) { + /** @var PaperContainer\Item $papier */ + + foreach ($container->getItems() as $papier) { + /** @var Paper $paper */ + $paper = $this->getPaperRepository()->findOneBy(['artNr' => $papier->getId()]); + if ($paper) { + $optPapier = new \PSC\Library\Calc\Option\Type\Select\PaperOpt(); + $optPapier->setId($paper->getArtNr()); + $optPapier->setLabel($paper->getDescription1()); + $optPapier->setPaper($paper); + $optPapier->setValue($papier->getValue()); + $optPapier->setEdgesCollectionContainer($papier->getEdgesCollectionContainer()); + $this->element->addOption($optPapier); + } + } + } + } } private function parseModeColorDbXML(): void