• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/V2/Entity/Url/RichData.php
  • Класс: BitrixImV2EntityUrlRichData
  • Вызов: RichData::initByAttach
static function initByAttach(?CIMMessageParamAttach $attach): self
{
	$rich = new static();

	if ($attach === null)
	{
		return $rich;
	}

	$arrayAttach = $attach->GetArray();
	$richLink = $arrayAttach['BLOCKS'][0]['RICH_LINK'][0];
	$rich->setType(RichData::LINK_TYPE)
		->setDescription($richLink['DESC'])
		->setName($richLink['NAME'])
		->setPreviewUrl($richLink['PREVIEW'])
	;

	return $rich;
}