Add Saved Values vom DB
This commit is contained in:
parent
ca26e6a7d1
commit
1bfb9cbd6f
@ -72,13 +72,15 @@ class Valid
|
||||
|
||||
if($this->engine->getVariables()[$option->getId()] == $opt->getId()) {
|
||||
$opt->setIsSelected(true);
|
||||
}else{
|
||||
$opt->setIsSelected(false);
|
||||
}
|
||||
|
||||
if($opt->isValid() && !$valid) {
|
||||
$valid = true;
|
||||
}
|
||||
}
|
||||
|
||||
$option->processValue();
|
||||
$option->setIsValid($valid);
|
||||
|
||||
}
|
||||
|
||||
@ -22,6 +22,7 @@ class PaperDbSelect extends Select
|
||||
$opt->setId($this->savedCalcValues[$this->getId()]['art_nr']);
|
||||
$opt->setLabel($this->savedCalcValues[$this->getId()]['description_1']);
|
||||
|
||||
|
||||
$paper = $this->newPaperObject;
|
||||
$paper->setId($this->savedCalcValues[$this->getId()]['id']);
|
||||
$paper->setArtNr($this->savedCalcValues[$this->getId()]['art_nr']);
|
||||
@ -37,6 +38,8 @@ class PaperDbSelect extends Select
|
||||
|
||||
$opt->setPaper($paper);
|
||||
|
||||
$this->addOption($opt);
|
||||
|
||||
return $opt;
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,12 +37,9 @@ class Select extends Base
|
||||
*/
|
||||
public function processValue()
|
||||
{
|
||||
/** @var Opt $opt */
|
||||
foreach($this->options as $opt)
|
||||
{
|
||||
if($opt->getId() == $this->getRawValue()) {
|
||||
$this->setValue($opt->getLabel());
|
||||
}
|
||||
$option = $this->getSelectedOption();
|
||||
if($option) {
|
||||
$this->setValue($option->getLabel());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -52,5 +52,7 @@ class PaperSavedTest extends \PHPUnit_Framework_TestCase
|
||||
"offset_fix" => "0", "offset_var" => "0", "digital_fix" => "0", "digital_var" => "0", "volume" => "0.118" ] ]);
|
||||
|
||||
$this->assertEquals(162.19, $this->engine->getPrice());
|
||||
|
||||
$this->assertEquals("Bilderdruck matt 250 gr", $this->engine->getArticle()->getOptionById('papier')->getValue());
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user