calc/src/Option/Parser/Select/DeliveryOpt.php
2025-06-24 11:57:42 +02:00

62 lines
1.7 KiB
PHP

<?php
namespace PSC\Library\Calc\Option\Parser\Select;
use PSC\Library\Calc\General\Parser\EdgeCollectionContainer;
use PSC\Library\Calc\Option\Parser\Base;
class DeliveryOpt extends Opt
{
public function __construct()
{
$this->element = new \PSC\Library\Calc\Option\Type\Select\DeliveryOpt();
}
public function parseJson()
{
parent::parseJson();
if(isset($this->json['info'])) {
$this->element->setInfo((string)$this->json['info']);
}
if(isset($this->json['country'])) {
$this->element->setCountry((string)$this->json['country']);
}
if(isset($this->json['dateFormat'])) {
$this->element->setDateFormat((string)$this->json['dateFormat']);
}
if(isset($this->json['maxTime'])) {
$this->element->setMaxTime((int)$this->json['maxTime']);
}
if(isset($this->json['workDays'])) {
$this->element->setWorkDays((int)$this->json['workDays']);
}
return $this->element;
}
public function parseXML()
{
parent::parseXML();
if(isset($this->node['info'])) {
$this->element->setInfo((string)$this->node['info']);
}
if(isset($this->node['country'])) {
$this->element->setCountry((string)$this->node['country']);
}
if(isset($this->node['dateFormat'])) {
$this->element->setDateFormat((string)$this->node['dateFormat']);
}
if(isset($this->node['maxTime'])) {
$this->element->setMaxTime((int)$this->node['maxTime']);
}
if(isset($this->node['workDays'])) {
$this->element->setWorkDays((int)$this->node['workDays']);
}
return $this->element;
}
}