CCrmRestEventDispatcher::ensureEntityIdsDefined

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmRestEventDispatcher
  4. ensureEntityIdsDefined
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/restservice.php
  • Класс: \CCrmRestEventDispatcher
  • Вызов: CCrmRestEventDispatcher::ensureEntityIdsDefined
static function ensureEntityIdsDefined()
{
	if (self::$entityIds === null)
	{
		self::$entityIds = [
			CCrmOwnerType::Lead => CCrmLead::$sUFEntityID,
			CCrmOwnerType::Company => CCrmCompany::$sUFEntityID,
			CCrmOwnerType::Contact => CCrmContact::$sUFEntityID,
			CCrmOwnerType::Requisite => Bitrix\Crm\EntityRequisite::$sUFEntityID,
			CCrmOwnerType::Deal => CCrmDeal::$sUFEntityID,
			CCrmOwnerType::Quote => CCrmQuote::$sUFEntityID,
			CCrmOwnerType::Invoice => CCrmInvoice::$sUFEntityID,
			CCrmOwnerType::SmartInvoice => Service\Factory\SmartInvoice::USER_FIELD_ENTITY_ID,
		];

		$dynamicTypesMap = Service\Container::getInstance()->getDynamicTypesMap()->load([
			'isLoadStages' => false,
			'isLoadCategories' => false,
		]);
		$typeFactory = ServiceLocator::getInstance()->get('crm.type.factory');
		foreach ($dynamicTypesMap->getTypes() as $type)
		{
			self::$entityIds[$type->getEntityTypeId()] = $typeFactory->getUserFieldEntityId($type->getId());
		}
	}
}

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