CCrmOwnerTypeAbbr::ResolveByTypeName

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

	if ($typeName === '')
	{
		return self::Undefined;
	}

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

			return self::Undefined;
	}
}

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