transitState example

$this->connection->beginTransaction();

        try {
            $transitions = array_filter([
                self::ORDER => $config[self::ORDER] ?? null,
                self::ORDER_DELIVERY => $config[self::ORDER_DELIVERY] ?? null,
                self::ORDER_TRANSACTION => $config[self::ORDER_TRANSACTION] ?? null,
            ]);

            foreach ($transitions as $machine => $toPlace) {
                $this->transitState((string) $machine$orderId(string) $toPlace$context);
            }

            $this->connection->commit();
        } catch (ShopwareHttpException $e) {
            $this->connection->rollBack();
            $this->logger->error($e->getMessage());
        } finally {
            $context->removeState(self::FORCE_TRANSITION);
        }
    }

    
Home | Imprint | This part of the site doesn't use cookies.