| Total Complexity | 4 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | class Address extends AbstractAgenda |
||
| 14 | { |
||
| 15 | use Common\SetNamespaceTrait; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * {@inheritdoc} |
||
| 19 | */ |
||
| 20 | 55 | public function setData(Common\Dtos\AbstractDto $data): parent |
|
| 21 | { |
||
| 22 | // process address |
||
| 23 | 55 | if (isset($data->address)) { |
|
| 24 | 22 | $address = new AddressType($this->dependenciesFactory); |
|
| 25 | 22 | $address |
|
| 26 | 22 | ->setDirectionalVariable($this->useOneDirectionalVariables) |
|
| 27 | 22 | ->setResolveOptions($this->resolveOptions) |
|
| 28 | 22 | ->setData($data->address); |
|
| 29 | 22 | $data->address = $address; |
|
| 30 | } |
||
| 31 | |||
| 32 | // process shipping address |
||
| 33 | 55 | if (isset($data->shipToAddress)) { |
|
| 34 | 1 | $shipTo = new ShipToAddressType($this->dependenciesFactory); |
|
| 35 | 1 | $shipTo |
|
| 36 | 1 | ->setDirectionalVariable($this->useOneDirectionalVariables) |
|
| 37 | 1 | ->setResolveOptions($this->resolveOptions) |
|
| 38 | 1 | ->setData($data->shipToAddress); |
|
| 39 | 1 | $data->shipToAddress = $shipTo; |
|
| 40 | } |
||
| 41 | |||
| 42 | 55 | return parent::setData($data); |
|
|
|
|||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * {@inheritDoc} |
||
| 47 | */ |
||
| 48 | 55 | protected function getDefaultDto(): Common\Dtos\AbstractDto |
|
| 51 | } |
||
| 52 | } |
||
| 53 |