• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/engine/response/converter.php
  • Класс: BitrixMainEngineResponseConverter
  • Вызов: Converter::formatArray
protected function formatArray(array $array)
{
	$newData = [];
	foreach ($array as $key => $item)
	{
		$itemConverted = false;
		if ($this->format & self::VALUES)
		{
			if (($this->format & self::RECURSIVE) && is_array($item))
			{
				$item = $this->process($item);
			}
			elseif (is_string($item))
			{
				$item = $this->formatString($item);
			}

			$itemConverted = true;
		}

		if ($this->format & self::KEYS)
		{
			if (!is_int($key))
			{
				$key = $this->formatString($key);
			}

			if (($this->format & self::RECURSIVE) && is_array($item) && !$itemConverted)
			{
				$item = $this->formatArray($item);
			}
		}

		$newData[$key] = $item;
	}

	return $newData;
}