alex-kalanis /
pohoda
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | namespace kalanis\Pohoda\Contract; |
||
| 6 | |||
| 7 | use kalanis\Pohoda\AbstractAgenda; |
||
| 8 | use kalanis\Pohoda\Common; |
||
| 9 | use kalanis\Pohoda\Type\Address; |
||
| 10 | |||
| 11 | /** |
||
| 12 | * @property DescDto $data |
||
| 13 | */ |
||
| 14 | class Desc extends AbstractAgenda |
||
| 15 | { |
||
| 16 | use Common\AddParameterTrait; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * {@inheritdoc} |
||
| 20 | */ |
||
| 21 | 4 | public function setData(Common\Dtos\AbstractDto $data): parent |
|
| 22 | { |
||
| 23 | // process partner identity |
||
| 24 | 4 | if (isset($data->partnerIdentity)) { |
|
| 25 | 1 | $partnerIdentity = new Address($this->dependenciesFactory); |
|
| 26 | 1 | $partnerIdentity |
|
| 27 | 1 | ->setDirectionalVariable($this->useOneDirectionalVariables) |
|
| 28 | 1 | ->setResolveOptions($this->resolveOptions) |
|
| 29 | 1 | ->setData($data->partnerIdentity); |
|
| 30 | 1 | $data->partnerIdentity = $partnerIdentity; |
|
| 31 | } |
||
| 32 | |||
| 33 | 4 | return parent::setData($data); |
|
|
0 ignored issues
–
show
Bug
Best Practice
introduced
by
Loading history...
|
|||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * {@inheritdoc} |
||
| 38 | */ |
||
| 39 | 3 | public function getXML(): \SimpleXMLElement |
|
| 40 | { |
||
| 41 | 3 | $xml = $this->createXML()->addChild('con:contractDesc', '', $this->namespace('con')); |
|
| 42 | |||
| 43 | 3 | $this->addElements($xml, $this->getDataElements(), 'con'); |
|
| 44 | |||
| 45 | 3 | return $xml; |
|
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * {@inheritdoc} |
||
| 50 | */ |
||
| 51 | 4 | protected function getDefaultDto(): Common\Dtos\AbstractDto |
|
| 52 | { |
||
| 53 | 4 | return new DescDto(); |
|
| 54 | } |
||
| 55 | } |
||
| 56 |