43 lines
1.1 KiB
PHP
43 lines
1.1 KiB
PHP
<?php
|
|
namespace PSC\Library\Calc\Option\Parser;
|
|
|
|
use Doctrine\Persistence\ObjectRepository;
|
|
use PSC\Library\Calc\General\Parser\EdgeCollectionContainer;
|
|
use PSC\Library\Calc\Option\Parser\Radio\Opt;
|
|
use PSC\Library\Calc\Option\Type\Radio as PSCRadio;
|
|
use PSC\Library\Calc\PaperContainer;
|
|
use PSC\Library\Calc\Tests\Mock\Paper;
|
|
|
|
class Radio extends Base
|
|
{
|
|
|
|
protected $element;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->element = new \PSC\Library\Calc\Option\Type\Radio();
|
|
}
|
|
|
|
public function parseXML(): PSCRadio
|
|
{
|
|
parent::parseXML();
|
|
|
|
if(isset($this->node->grenzen) && $this->node->grenzen->children()) {
|
|
$edgeCollectionContainerParser = new EdgeCollectionContainer($this->node->grenzen);
|
|
$this->element->setEdgesCollectionContainer($edgeCollectionContainerParser->parse());
|
|
}
|
|
|
|
$this->parseModeNormal();
|
|
|
|
return $this->element;
|
|
}
|
|
|
|
private function parseModeNormal()
|
|
{
|
|
foreach ($this->node->opt as $opt) {
|
|
$optParser = new Opt($opt);
|
|
$this->element->addOption($optParser->parse());
|
|
}
|
|
}
|
|
}
|