if (isset($data['cleared'
])) { $data['paymentStatus'
] =
$this->
getManager()->
find(Status::
class,
$data['cleared'
]);
} else { unset($data['paymentStatus'
]);
} // The documents will be created over the "createDocumentAction" so we have to unset the array element, otherwise the
// created documents models would be overwritten.
// For now the paymentInstances information is not editable, so it's just discarded at this point
unset($data['documents'
],
$data['paymentInstances'
]);
$data['billing'
] =
$this->
prepareAddressData($data['billing'
][0
]);
$data['shipping'
] =
$this->
prepareAddressData($data['shipping'
][0
]);
// Unset calculated values
unset($data['invoiceAmountNet'
],
$data['invoiceAmountEuro'
]);
// At last, we return the prepared associated data
return $data;
} /**
* Creates the status mail order for the passed order id and new status object.
*
* @return array{mail: Enlight_Components_Mail, data: array<string, mixed>}|null
*/