• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/binding/bindinghelper.php
  • Класс: Bitrix\Crm\Binding\BindingHelper
  • Вызов: BindingHelper::getBulkEntityBindings
static function getBulkEntityBindings(int $ownerTypeId, array $ownerIds, int $entityTypeId): ?array
{
	if ($ownerTypeId === \CCrmOwnerType::Lead && $entityTypeId === \CCrmOwnerType::Contact)
	{
		return LeadContactTable::getBulkLeadBindings($ownerIds);
	}
	if ($ownerTypeId === \CCrmOwnerType::Deal && $entityTypeId === \CCrmOwnerType::Contact)
	{
		return DealContactTable::getBulkDealBindings($ownerIds);
	}
	if ($ownerTypeId === \CCrmOwnerType::Contact && $entityTypeId === \CCrmOwnerType::Company)
	{
		return ContactCompanyTable::getBulkContactBindings($ownerIds);
	}
	if ($ownerTypeId === \CCrmOwnerType::Company && $entityTypeId === \CCrmOwnerType::Contact)
	{
		return ContactCompanyTable::getBulkCompanyBindings($ownerIds);
	}
	if ($ownerTypeId === \CCrmOwnerType::Quote && $entityTypeId === \CCrmOwnerType::Contact)
	{
		return QuoteContactTable::getBulkQuoteBindings($ownerIds);
	}
	if (\CCrmOwnerType::isUseDynamicTypeBasedApproach($ownerTypeId) && $entityTypeId === \CCrmOwnerType::Contact)
	{
		return EntityContactTable::getBulkContactBindings($ownerTypeId, $ownerIds);
	}

	return null;
}