CCrmDocumentLead::getDocumentName

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmDocumentLead
  4. getDocumentName
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_document_lead.php
  • Класс: \CCrmDocumentLead
  • Вызов: CCrmDocumentLead::getDocumentName
static function getDocumentName($documentId)
{
	$arDocumentID = self::GetDocumentInfo($documentId);
	$caption = '';

	$dbRes = CCrmLead::GetListEx([], ['=ID' => $arDocumentID['ID'], 'CHECK_PERMISSIONS' => 'N'],
		false, false,
		['TITLE', 'HONORIFIC', 'NAME', 'SECOND_NAME', 'LAST_NAME']
	);
	$arRes = $dbRes ? $dbRes->Fetch() : null;

	if ($arRes)
	{
		$caption = isset($arRes['TITLE']) ? $arRes['TITLE'] : '';
		if ($caption === '')
		{
			$caption = CCrmLead::PrepareFormattedName(
				array(
					'HONORIFIC'   => isset($arRes['HONORIFIC']) ? $arRes['HONORIFIC'] : '',
					'NAME'        => isset($arRes['NAME']) ? $arRes['NAME'] : '',
					'SECOND_NAME' => isset($arRes['SECOND_NAME']) ? $arRes['SECOND_NAME'] : '',
					'LAST_NAME'   => isset($arRes['LAST_NAME']) ? $arRes['LAST_NAME'] : ''
				)
			);
		}
	}

	return $caption;
}

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