• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/helpers/admin/blocks/orderbuyer.php
  • Класс: BitrixSaleHelpersAdminBlocksOrderBuyer
  • Вызов: OrderBuyer::getRelPropData
static function getRelPropData(SaleOrder $order)
{
	$result = array();
	$groups = array();

	$items = $order->getPropertyCollection()->getArray();
	foreach ($items as $key => $item)
	{
		if ($key == 'properties')
		{
			$result[$key] = array();
			foreach ($item as $property)
			{
				if (!empty($property['RELATION']))
				{
					if ($property['TYPE'] === 'ENUM' && is_array($property['OPTIONS']))
					{
						$property['OPTIONS_SORT'] = array_keys($property['OPTIONS']);
					}
					$result[$key][] = $property;
					$groups[$property['PROPS_GROUP_ID']] = true;
				}
			}
		}
		else
		{
			$result[$key] = $item;
		}
	}

	foreach ($result['groups'] as $i => $group)
	{
		if (!isset($groups[$group['ID']]))
			unset($result['groups'][$i]);
	}

	return $result;
}