diff --git a/src/QUI/ERP/Order/Handler.php b/src/QUI/ERP/Order/Handler.php index d4a91a0f62bb22e57711b2dcb99ff4cf1da54c9a..b96f1a867731f28c9c625552fd8397e9333c3995 100644 --- a/src/QUI/ERP/Order/Handler.php +++ b/src/QUI/ERP/Order/Handler.php @@ -42,11 +42,6 @@ class Handler extends Singleton */ protected array $cache = []; - /** - * @var array - */ - protected array $orders = []; - /** * Return all order process Provider * @@ -103,22 +98,6 @@ public function getOrderProcessProvider(): array return $result; } - /** - * Remove an order instance - * - * @param $orderId - */ - public function removeFromInstanceCache($orderId): void - { - if (isset($this->orders[$orderId])) { - unset($this->orders[$orderId]); - } - - if (isset($this->cache[$orderId])) { - unset($this->cache[$orderId]); - } - } - //region Order /** @@ -142,11 +121,7 @@ public function table(): string */ public function get(int|string $orderId): Order { - if (!isset($this->orders[$orderId])) { - $this->orders[$orderId] = new Order($orderId); - } - - return $this->orders[$orderId]; + return new Order($orderId); } /** @@ -615,11 +590,7 @@ public function tableOrderProcess(): string */ public function getOrderInProcess($orderId): OrderInProcess { - if (!isset($this->cache[$orderId])) { - $this->cache[$orderId] = new OrderInProcess($orderId); - } - - return $this->cache[$orderId]; + return new OrderInProcess($orderId); } /** diff --git a/src/QUI/ERP/Order/OrderInProcess.php b/src/QUI/ERP/Order/OrderInProcess.php index 9ca44c3dbfe9173718d5d491c27376002c5ea5a8..614bb0d4c57d3f2f7ecee743ba33c6046f3bd124 100644 --- a/src/QUI/ERP/Order/OrderInProcess.php +++ b/src/QUI/ERP/Order/OrderInProcess.php @@ -71,7 +71,6 @@ public function refresh(): void } try { - Handler::getInstance()->removeFromInstanceCache($this->orderId); $Order = Handler::getInstance()->get($this->orderId); if (!$Order->isSuccessful()) {