• Модуль: iblock
  • Путь к файлу: ~/bitrix/modules/iblock/lib/component/filters.php
  • Класс: BitrixIblockComponentFilters
  • Вызов: Filters::getFilteredOffersByProduct
static function getFilteredOffersByProduct($iblockId, $propertyId, array $filter)
{
	$result = array();
	$iblockId = (int)$iblockId;
	$propertyId = (int)$propertyId;
	if ($iblockId <= 0 || $propertyId <= 0)
		return $result;
	if (empty($filter) || !is_array($filter))
		return $result;

	$valuesIterator = CIBlockElement::getPropertyValues($iblockId, $filter, false, array('ID' => $propertyId));
	while ($value = $valuesIterator->fetch())
	{
		$productId = (int)$value[$propertyId];
		$offerId = (int)$value['IBLOCK_ELEMENT_ID'];
		if (!isset($result[$productId]))
			$result[$productId] = array();
		$result[$productId][$offerId] = $offerId;
	}
	unset($value, $valuesIterator);

	return $result;
}