CCrmOwnerTypeAbbr::ResolveName

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmOwnerTypeAbbr
  4. ResolveName
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_owner_type.php
  • Класс: \CCrmOwnerTypeAbbr
  • Вызов: CCrmOwnerTypeAbbr::ResolveName
static function ResolveName($abbr)
{
	if(!is_string($abbr))
	{
		$abbr = (string)$abbr;
	}

	$abbr = mb_strtoupper(trim($abbr));
	if($abbr === '')
	{
		return '';
	}

	switch($abbr)
	{
		case self::Lead:
			return CCrmOwnerType::LeadName;
		case self::SuspendedLead:
			return CCrmOwnerType::SuspendedLead;
		case self::Deal:
			return CCrmOwnerType::DealName;
		case self::SuspendedDeal:
			return CCrmOwnerType::SuspendedDealName;
		case self::Contact:
			return CCrmOwnerType::ContactName;
		case self::Company:
			return CCrmOwnerType::CompanyName;
		case self::Invoice:
			return CCrmOwnerType::InvoiceName;
		case self::Quote:
			return CCrmOwnerType::QuoteName;
		case self::Order:
			return CCrmOwnerType::OrderName;
		case self::OrderShipment:
			return CCrmOwnerType::OrderShipmentName;
		case self::OrderPayment:
			return CCrmOwnerType::OrderPaymentName;
		case self::Requisite:
			return CCrmOwnerType::RequisiteName;
		case self::DealCategory:
			return CCrmOwnerType::DealCategoryName;
		case self::CustomActivityType:
			return CCrmOwnerType::CustomActivityTypeName;
		case self::SmartInvoice:
			return CCrmOwnerType::SmartInvoiceName;
		case self::SuspendedSmartInvoice:
			return CCrmOwnerType::SuspendedSmartInvoiceName;
		case self::SmartDocument:
			return CCrmOwnerType::SmartDocumentName;
		case self::SuspendedSmartDocument:
			return CCrmOwnerType::SuspendedSmartDocumentName;
		case self::System:
			return CCrmOwnerType::SystemName;
		default:
			$typeId = self::extractTypeIdFromDynamicTypeAbbreviation($abbr);
			if (!is_null($typeId))
			{
				return CCrmOwnerType::ResolveName($typeId);
			}

			$suspendedTypeId = self::extractTypeIdFromSuspendedDynamicTypeAbbreviation($abbr);
			if (!is_null($suspendedTypeId))
			{
				return CCrmOwnerType::ResolveName($suspendedTypeId);
			}
	}
	return '';
}

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