• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/Service/Factory.php
  • Класс: Bitrix\Crm\Service\Factory
  • Вызов: Factory::getFieldCaption
public function getFieldCaption(string $commonFieldName): string
{
	$titles = $this->getFieldTitlesMap();
	if (isset($titles[$commonFieldName]))
	{
		return $titles[$commonFieldName];
	}

	if (ParentFieldManager::isParentFieldName($commonFieldName))
	{
		$parentEntityTypeId = ParentFieldManager::getEntityTypeIdFromFieldName($commonFieldName);
		return \CCrmOwnerType::GetDescription($parentEntityTypeId);
	}

	if (!$this->isFieldExists($commonFieldName))
	{
		return $commonFieldName;
	}

	$entityFieldName = $this->getEntityFieldNameByMap($commonFieldName);

	if ($this->getDataClass()::getEntity()->hasField($entityFieldName))
	{
		$caption = (string)$this->getDataClass()::getEntity()->getField($entityFieldName)->getTitle();
	}

	if ( (!empty($caption)) && ($caption !== $entityFieldName) )
	{
		return $caption;
	}

	return $commonFieldName;
}