if (!
$order instanceof Order
) { $this->
View()->
assign([ 'success' => false,
'data' =>
$this->
Request()->
getParams(),
'message' =>
$namespace->
get('no_order_id_passed', 'No valid order id passed.'
),
]);
return;
} $lastOrderChange =
new DateTime($this->
Request()->
getParam('changed', ''
));
if ($this->
checkIfOrderHasBeenModifiedSince($lastOrderChange,
$order,
$namespace)) { return;
} // Check if the passed position data is a new position or an existing position.
$position =
$this->
getManager()->
getRepository(OrderDetail::
class)->
find($id);
if (!
$position instanceof OrderDetail
) { $position =
new OrderDetail();
$attribute =
new OrderDetailAttribute();
$position->
setAttribute($attribute);
$this->
getManager()->
persist($position);
}