• Модуль: imopenlines
  • Путь к файлу: ~/bitrix/modules/imopenlines/lib/crm/common.php
  • Класс: BitrixImOpenLinesCrmCommon
  • Вызов: Common::formatMultifieldFields
static function formatMultifieldFields($fields)
{
	$destinationData = [];
	if (is_array($fields))
	{
		foreach ($fields as $typeID => $typeData)
		{
			$counter = 0;
			$results = [];
			foreach ($typeData as $valueType => $values)
			{
				for ($i = 0, $length = count($values); $i < $length; $i++)
				{
					$results["n{$counter}"] = ['VALUE_TYPE' => $valueType, 'VALUE' => $values[$i]];
					$counter++;
				}
			}

			$destinationData[$typeID] = $results;
		}
	}

	return $destinationData;
}