Refactor order and order item management: add cache invalidation, improve object change tracking, and enhance asArray conversion with caching and expiration support.
This commit is contained in:
@@ -41,7 +41,7 @@ class ordersRoute
|
||||
// Log the incident
|
||||
(new logs_o())->add('orders', 'global', 1, $user->id, 'LIST_ORDERS', 'Successfully listed orders');
|
||||
// Create economic_module_orders object
|
||||
$economic_module_orders = new economic_module_orders();
|
||||
//$economic_module_orders = new economic_module_orders();
|
||||
$orders = new orders_o();
|
||||
if (!$restrict_only_own) {
|
||||
$department_ids = $user->getGroup()->getDepartments();
|
||||
@@ -216,7 +216,8 @@ class ordersRoute
|
||||
if (isset($data['created_at'])) {
|
||||
$order->created_at->set($data['created_at']);
|
||||
}
|
||||
// If the department ID is set, validate it
|
||||
// Void any cached key for the order
|
||||
$order->objectChanged();
|
||||
// Log the incident
|
||||
(new logs_o())->add('orders', $order->department_id->value(), 1, $user->id, 'EDIT_ORDER', 'Successfully updated an order (ID: ' . $data['id'] . ')');
|
||||
// Return a success message
|
||||
|
||||
Reference in New Issue
Block a user