How do I programmatically change the user ID in a order?
It should be as simple as:

$order-&gt;setCustomer($user)-&gt;save();


Or if you only have the user ID and don't want to load the account object:

$order-&gt;set('uid', $uid);
$order-&gt;save();