• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/Reservation/Entity/Base.php
  • Класс: Bitrix\Crm\Reservation\Entity\Base
  • Вызов: Base::loadEntityProducts
public function loadEntityProducts(): array;

/**
 * @param Crm\Reservation\Product $product
 * @throws Main\ArgumentException
 */
public function addProduct(Crm\Reservation\Product $product): void
{
	$id = $product->getId();
	if (!isset($this->entityProducts[$id]))
	{
		throw new Main\ArgumentException("Product with id {$id} not found in entity products");
	}

	$quantity = $product->getQuantity();
	if ($this->entityProducts[$id]['QUANTITY'] < $quantity)
	{
		throw new Main\ArgumentException("Quantity {$quantity} larger than quantity in entity");
	}

	$xmlId = $product->getXmlId();
	$this->products[$xmlId] = $product;
}