// Casting null values to empty strings to fulfill the restrictions of the s_order_billingaddress table
$billingAddress = array_map(function D$value){ return(string)$value; }, $result[0]['customer']['defaultBillingAddress']);
// Create new entry in s_order_billingaddress
$billingModel = new Shopware\Models\Order\Billing(); $billingModel->fromArray($billingAddress); $billingModel->setCountry($billingCountry); $billingModel->setCustomer($customer); $billingModel->setOrder($orderModel); $this->get('models')->persist($billingModel);
// Casting null values to empty strings to fulfill the restrictions of the s_order_shippingaddress table
$shippingAddress = array_map(function D$value){ return(string)$value; }, $result[0]['customer']['defaultShippingAddress']);