| Total Complexity | 5 |
| Total Lines | 39 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | class StockItem extends AbstractAgenda |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * {@inheritdoc} |
||
| 17 | */ |
||
| 18 | 1 | public function setData(Common\Dtos\AbstractDto $data): parent |
|
| 19 | { |
||
| 20 | // process stockPriceItem |
||
| 21 | 1 | if (!empty($data->stockPriceItem) && is_array($data->stockPriceItem)) { |
|
| 22 | 1 | $data->stockPriceItem = \array_map(function (PriceDto $stockPriceItem) { |
|
| 23 | 1 | $price = new Price($this->dependenciesFactory); |
|
| 24 | 1 | $price->setDirectionalVariable($this->useOneDirectionalVariables) |
|
| 25 | 1 | ->setResolveOptions($this->resolveOptions) |
|
| 26 | 1 | ->setData($stockPriceItem); |
|
| 27 | 1 | return $price; |
|
| 28 | 1 | }, $data->stockPriceItem); |
|
| 29 | } |
||
| 30 | |||
| 31 | 1 | return parent::setData($data); |
|
|
|
|||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * {@inheritdoc} |
||
| 36 | */ |
||
| 37 | 1 | public function getXML(): \SimpleXMLElement |
|
| 38 | { |
||
| 39 | 1 | $xml = $this->createXML()->addChild('stk:stockItem', '', $this->namespace('stk')); |
|
| 40 | |||
| 41 | 1 | $this->addElements($xml, $this->getDataElements(), 'stk'); |
|
| 42 | |||
| 43 | 1 | return $xml; |
|
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * {@inheritdoc} |
||
| 48 | */ |
||
| 49 | 1 | protected function getDefaultDto(): Common\Dtos\AbstractDto |
|
| 52 | } |
||
| 53 | } |
||
| 54 |