• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/ui.php
  • Класс: BitrixTasksUI
  • Вызов: UI::processObjects
static function processObjects($data)
{
	// todo: actually, there could be options.
	// todo: if object implements Iterator andor ArrayAccess, then better solution would be to iterate over it instead of casting to a string
	// todo: also, there could be "special" objects, that must be translated to js "in a special manner"

	if(is_object($data) && is_subclass_of($data, 'BitrixMainTypeDateTime'))
	{
		// as JSON does not support native js Date type, have to convert to a string representation of local user type
		return CUtil::JSEscape((string) $data);
	}
	elseif(is_array($data))
	{
		foreach($data as $k => $v)
		{
			$data[$k] = static::processObjects($v);
		}
	}

	return $data;
}