• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/recycling/dealbinder.php
  • Класс: Bitrix\Crm\Recycling\DealBinder
  • Вызов: DealBinder::getBoundEntityIDs
public function getBoundEntityIDs($associatedEntityTypeID, $associatedEntityID)
{
	if($associatedEntityTypeID === \CCrmOwnerType::Company)
	{
		$dbResult = \CCrmDeal::GetListEx(
			array(),
			array('=COMPANY_ID' => $associatedEntityID, 'CHECK_PERMISSIONS' => 'N'),
			false,
			false,
			array('ID')
		);

		$results = array();
		while($fields = $dbResult->Fetch())
		{
			$results[] = (int)$fields['ID'];
		}
		return $results;
	}
	elseif($associatedEntityTypeID === \CCrmOwnerType::Contact)
	{
		return Crm\Binding\DealContactTable::getContactDealIDs($associatedEntityID);
	}

	$entityTypeName = \CCrmOwnerType::ResolveName($associatedEntityTypeID);
	throw new Main\NotSupportedException("Entity '{$entityTypeName}' not supported in current context.");
}