• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/vcard/vcardelement.php
  • Класс: Bitrix\Crm\VCard\VCardElement
  • Вызов: VCardElement::parseFromArray
static function parseFromArray(array $array)
{
	$attributes = array();
	$qty = count($array);
	$s = '';
	for($i = $qty - 1; $i >= 0; $i--)
	{
		if($s === '')
		{
			$s = $array[$i];
		}
		else
		{
			//Try to parse multiline attribute
			$s = $array[$i].PHP_EOL.$s;
		}

		if(!VCardElementAttribute::isValidAttributeString($s))
		{
			continue;
		}

		$attr = VCardElementAttribute::parseFromString($s);
		if($attr !== null)
		{
			$name = $attr->getName();
			if(!isset($attributes[$name]))
			{
				$attributes[$name] = array();
			}
			array_unshift($attributes[$name], $attr);
		}
		$s = '';
	}
	return new VCardElement(array_reverse($attributes));
}