| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 33 | private function updateVatIdsInCustomer(array $vatIds, string $customerId): void |
||
| 34 | { |
||
| 35 | if (!empty($vatIds)) { |
||
| 36 | $this->connection->executeUpdate( |
||
| 37 | 'UPDATE `customer_address` SET `vat_id` = :vatId |
||
| 38 | WHERE `customer_address`.`customer_id` = :customerId |
||
| 39 | AND (customer_address.vat_id <> :vatId OR customer_address.vat_id IS NULL)', |
||
| 40 | [ |
||
| 41 | 'vatId' => $vatIds[0], |
||
| 42 | 'customerId' => Uuid::fromHexToBytes($customerId), |
||
| 43 | ] |
||
| 44 | ); |
||
| 45 | } else { |
||
| 46 | $this->connection->executeUpdate( |
||
| 47 | 'UPDATE `customer_address` SET `vat_id` = NULL WHERE `customer_id` = :customerId', |
||
| 48 | ['customerId' => Uuid::fromHexToBytes($customerId)] |
||
| 49 | ); |
||
| 53 |