public function setItems($list)
    {
        if (!is_array($list)) {
            $this->items = null;

            return;
        }

        $items = [];
        foreach ($list as $index => $element) {
            if ((!is_object($element) || !($element instanceof \ShopgateOrderItem)) && !is_array($element)) {
                unset($list[$index]);
                continue;
            }

            if ($element instanceof \ShopgateOrderItem) {
                $element = $element->toArray();
            }

            $item = $this->itemFactory->create();
            $item->loadArray($element);
            $items[$item->getItemNumber()] = $item;
        }

        $this->items = $items;
    }