• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/shipmentitemstore.php
  • Класс: BitrixSaleShipmentItemStore
  • Вызов: ShipmentItemStore::create
static function create(ShipmentItemStoreCollection $collection, BasketItem $basketItem)
{
	if (!$basketItem->isReservableItem())
	{
		throw new MainSystemException('Basket item is not available for reservation');
	}

	$shipmentItemStore = static::createShipmentItemStoreObject();
	$shipmentItemStore->setCollection($collection);

	$shipmentItem = $collection->getShipmentItem();
	if ($shipmentItem)
	{
		$fields = array(
			'ORDER_DELIVERY_BASKET_ID' => $collection->getShipmentItem()->getId(),
			'BASKET_ID' => $shipmentItem->getBasketItem()->getId(),
		);

		$shipmentItemStore->setFieldsNoDemand($fields);
	}

	return $shipmentItemStore;

}