Add Saved Values vom DB
This commit is contained in:
parent
529183a821
commit
ca26e6a7d1
@ -52,6 +52,7 @@ class Select extends Base
|
||||
|
||||
private function parseModePapierDb()
|
||||
{
|
||||
$this->element->setNewPaperObject($this->getPaperRepository()->getNewObject());
|
||||
/** @var PaperContainer\Container $container */
|
||||
$container = $this->getPaperContainer()->getContainerById((string)$this->node['container']);
|
||||
|
||||
|
||||
@ -7,6 +7,8 @@ use PSC\Library\Calc\Tests\Mock\Paper;
|
||||
|
||||
class PaperDbSelect extends Select
|
||||
{
|
||||
protected $newPaperObject = null;
|
||||
|
||||
public function getSelectedOption()
|
||||
{
|
||||
/** @var Opt $opt */
|
||||
@ -20,7 +22,7 @@ class PaperDbSelect extends Select
|
||||
$opt->setId($this->savedCalcValues[$this->getId()]['art_nr']);
|
||||
$opt->setLabel($this->savedCalcValues[$this->getId()]['description_1']);
|
||||
|
||||
$paper = new Paper();
|
||||
$paper = $this->newPaperObject;
|
||||
$paper->setId($this->savedCalcValues[$this->getId()]['id']);
|
||||
$paper->setArtNr($this->savedCalcValues[$this->getId()]['art_nr']);
|
||||
$paper->setDescription1($this->savedCalcValues[$this->getId()]['description_1']);
|
||||
@ -119,4 +121,12 @@ class PaperDbSelect extends Select
|
||||
return $variables;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null $newPaperObject
|
||||
*/
|
||||
public function setNewPaperObject($newPaperObject)
|
||||
{
|
||||
$this->newPaperObject = $newPaperObject;
|
||||
}
|
||||
|
||||
}
|
||||
@ -214,4 +214,9 @@ class PaperRepostory implements ObjectRepository
|
||||
{
|
||||
// TODO: Implement getClassName() method.
|
||||
}
|
||||
|
||||
public function getNewObject()
|
||||
{
|
||||
return new Paper();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user