CAllCrmActivity::PrepareUrn

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CAllCrmActivity
  4. PrepareUrn
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_activity.php
  • Класс: \CAllCrmActivity
  • Вызов: CAllCrmActivity::PrepareUrn
static function PrepareUrn(&$arFields)
{
	if(!is_array($arFields))
	{
		return '';
	}

	$ID = isset($arFields['ID']) ? intval($arFields['ID']) : 0;
	if($ID <= 0)
	{
		return '';
	}

	// URN: [ID]-[CHECK_WORD]-[OWNER_ID]-[OWNER_TYPE_ID]
	$urn = "{$ID}-".randString(6, 'ABCDEFGHIJKLNMOPQRSTUVWXYZ0123456789');

	//$ownerID = isset($arFields['OWNER_ID']) ? intval($arFields['OWNER_ID']) : 0;
	//$ownerTypeID = isset($arFields['OWNER_TYPE_ID']) ? intval($arFields['OWNER_TYPE_ID']) : 0;
	//if($ownerID > 0 && $ownerTypeID > 0)
	//{
	//	$urn .= "-{$ownerID}-{$ownerTypeID}";
	//}

	return $urn;
}

Добавить комментарий