22 if (empty($filter) || !is_array($filter))
25 $itemsIterator = \CIBlockElement::getList(array(), $filter,
false,
false, array(
'ID'));
26 while ($item = $itemsIterator->fetch())
28 $item[
'ID'] = (int)$item[
'ID'];
29 $result[$item[
'ID']] = $item[
'ID'];
31 unset($item, $itemsIterator);
47 $iblockId = (int)$iblockId;
48 $propertyId = (int)$propertyId;
49 if ($iblockId <= 0 || $propertyId <= 0)
51 if (empty($filter) || !is_array($filter))
54 $valuesIterator = \CIBlockElement::getPropertyValues($iblockId, $filter,
false, array(
'ID' => $propertyId));
55 while ($value = $valuesIterator->fetch())
57 $productId = (int)$value[$propertyId];
58 $offerId = (int)$value[
'IBLOCK_ELEMENT_ID'];
59 if (!isset($result[$productId]))
60 $result[$productId] = array();
61 $result[$productId][$offerId] = $offerId;
63 unset($value, $valuesIterator);