• Модуль: fileman
  • Путь к файлу: ~/bitrix/modules/fileman/lib/block/content/jsonconverter.php
  • Класс: BitrixFilemanBlockContentJsonConverter
  • Вызов: JsonConverter::toArray
static function toArray($string)
{
	$blockContent = new BlockContent();
	try
	{
		$list = Json::decode($string);
		if (!is_array($list))
		{
			return $blockContent;
		}
	}
	catch (ArgumentException $exception)
	{
		return $blockContent;
	}

	foreach ($list as $item)
	{
		$type = trim($item['type']);
		$place = trim($item['place']);
		$value = trim($item['value']);
		$blockContent->add($type, $place, $value);
	}

	return $blockContent;
}