src/Entities/Orders/MerchantItems.php
public static function createFromOrder(Order $order)
    {
        $groupedItems = [];

        foreach ($order->getItems() as $item) {
            $groupedItems = self::groupItem($item, $groupedItems);
        }

        $merchantItems = [];

        foreach ($groupedItems as $grouping) {
            $merchantItems[] = new static($grouping['org'], $grouping['items']);
        }

        return $merchantItems;
    }
public static function createFromOrder(Order $order)
    {
        $groupedItems = [];

        foreach ($order->getItems() as $item) {
            $groupedItems = self::groupItem($item, $groupedItems);
        }

        $merchantItems = [];

        foreach ($groupedItems as $grouping) {
            $merchantItems[] = new static($grouping['org'], $grouping['items']);
        }

        return $merchantItems;
    }
@param Order $order

@return array|static[]