CCrmOwnerType::ResolveName

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

	$typeID = (int)$typeID;
	if($typeID <= 0)
	{
		return '';
	}

	switch($typeID)
	{
		case self::Lead:
			return self::LeadName;

		case self::Deal:
			return self::DealName;

		case self::Contact:
			return self::ContactName;

		case self::Company:
			return self::CompanyName;

		case self::Invoice:
			return self::InvoiceName;

		case self::Activity:
			return self::ActivityName;

		case self::Quote:
			return self::QuoteName;

		case self::Order:
			return self::OrderName;

		case self::OrderCheck:
			return self::OrderCheckName;

		case self::OrderShipment:
			return self::OrderShipmentName;

		case self::OrderPayment:
			return self::OrderPaymentName;

		case self::Requisite:
			return self::RequisiteName;

		case self::DealCategory:
			return self::DealCategoryName;

		case self::DealRecurring:
			return self::DealRecurringName;

		case self::InvoiceRecurring:
			return self::InvoiceRecurringName;

		case self::CustomActivityType:
			return self::CustomActivityTypeName;

		case self::CallList:
			return self::CallListTypeName;

		case self::SuspendedLead:
			return self::SuspendedLeadName;

		case self::SuspendedDeal:
			return self::SuspendedDealName;

		case self::SuspendedContact:
			return self::SuspendedContactName;

		case self::SuspendedCompany:
			return self::SuspendedCompanyName;

		case self::SuspendedQuote:
			return self::SuspendedQuoteName;

		case self::SuspendedInvoice:
			return self::SuspendedInvoiceName;

		case self::SuspendedOrder:
			return self::SuspendedOrderName;

		case self::SuspendedActivity:
			return self::SuspendedActivityName;

		case self::Scoring:
			return self::ScoringName;

		case self::SmartInvoice:
			return self::SmartInvoiceName;

		case self::SuspendedSmartInvoice:
			return self::SuspendedSmartInvoiceName;

		case self::StoreDocument:
			return self::StoreDocumentName;

		case self::ShipmentDocument:
			return self::ShipmentDocumentName;

		case self::SmartDocument:
			return self::SmartDocumentName;

		case self::SuspendedSmartDocument:
			return self::SuspendedSmartDocumentName;

		case self::System:
			return self::SystemName;

		case self::AgentContractDocument:
			return self::AgentContractDocumentName;

		case self::Undefined:
			return '';

		default:
			$isPossibleDynamicTypeId = static::isPossibleDynamicTypeId($typeID);
			$isPossibleSuspendedDynamicTypeId = static::isPossibleSuspendedDynamicTypeId($typeID);
			if($isPossibleDynamicTypeId || $isPossibleSuspendedDynamicTypeId)
			{
				return (
					$isPossibleDynamicTypeId ? static::DynamicTypePrefixName : static::SuspendedDynamicTypePrefixName
				) . $typeID;
			}

			return '';
	}
}

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