• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/order/productmanager.php
  • Класс: Bitrix\Crm\Order\ProductManager
  • Вызов: ProductManager::getDealProductList
protected function getDealProductList(): array
{
	$rows = \CCrmDeal::LoadProductRows($this->ownerId);
	if (!$rows)
	{
		return [];
	}

	$rowIds = array_column($rows, 'ID');
	$reserveData = Crm\Reservation\Internals\ProductRowReservationTable::getList([
		'filter' => ['=ROW_ID' => $rowIds],
	]);

	$reserveRowMap = [];
	while ($reservation = $reserveData->fetch())
	{
		$rowId = $reservation['ROW_ID'];
		unset($reservation['ID'], $reservation['ROW_ID']);

		if ($reservation['DATE_RESERVE_END'] instanceof Date)
		{
			$reservation['DATE_RESERVE_END'] = $reservation['DATE_RESERVE_END']->toString();
		}
		$reserveRowMap[$rowId] = $reservation;
	}

	foreach ($rows as &$row)
	{
		$id = $row['ID'];
		if (is_array($reserveRowMap[$id]))
		{
			$row += $reserveRowMap[$id];
		}
	}

	return $rows;
}