• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/recycling/leadbinder.php
  • Класс: Bitrix\Crm\Recycling\LeadBinder
  • Вызов: LeadBinder::getBoundEntityIDs
public function getBoundEntityIDs($associatedEntityTypeID, $associatedEntityID)
{
	if($associatedEntityTypeID === \CCrmOwnerType::Company)
	{
		$results = array();
		$dbResult = Crm\LeadTable::getList(
			array(
				'select' => array('ID'),
				'filter' => array('=COMPANY_ID' => $associatedEntityID)
			)
		);
		while($fields = $dbResult->fetch())
		{
			$results[] = (int)$fields['ID'];
		}
		return $results;
	}

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