WIP: Implement closer BPN integration
This commit is contained in:
@@ -12,7 +12,6 @@ use App\BusProNet\Model\CrmAttributesResponse;
|
||||
use App\BusProNet\Model\Hotel;
|
||||
use App\BusProNet\Model\NotificationResponse;
|
||||
use App\BusProNet\Model\Pickup;
|
||||
use App\BusProNet\Model\Product;
|
||||
use App\BusProNet\Model\ProfileResponse;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
@@ -59,8 +58,6 @@ class ResponseParser
|
||||
return $this->createPickupsResponse($xml);
|
||||
case ApiClient::TYPE_BASE_DATA_HOTELS:
|
||||
return $this->createHotelsResponse($xml);
|
||||
case ApiClient::TYPE_PRODUCTS:
|
||||
return $this->createProductsResponse($xml);
|
||||
}
|
||||
|
||||
throw new ResponseParserException('Unable to parse XML response');
|
||||
@@ -241,28 +238,6 @@ class ResponseParser
|
||||
return new BaseDataResponse($hotels);
|
||||
}
|
||||
|
||||
public function createProductsResponse(\SimpleXMLElement $xml): BaseDataResponse
|
||||
{
|
||||
$products = [];
|
||||
|
||||
foreach ($xml->xpath('produkte/produkt') as $item) {
|
||||
$code = (string) $item->attributes()['code'];
|
||||
if (true === empty($code)) {
|
||||
continue;
|
||||
}
|
||||
$id = (int) $item->attributes()['id'];
|
||||
$product = new Product();
|
||||
$product
|
||||
->setId($id)
|
||||
->setName((string) $item->attributes()['bezeichnung'])
|
||||
->setCode($code)
|
||||
;
|
||||
$products[$id] = $product;
|
||||
}
|
||||
|
||||
return new BaseDataResponse($products);
|
||||
}
|
||||
|
||||
private function resolveOptions(array $options): array
|
||||
{
|
||||
$optionsResolver = new OptionsResolver();
|
||||
|
||||
Reference in New Issue
Block a user