• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/binding/contactcompany.php
  • Класс: Bitrix\Crm\Binding\ContactCompanyTable
  • Вызов: ContactCompanyTable::getCompanyContactIDs
static function getCompanyContactIDs($companyID)
{
	$companyID = (int)$companyID;
	if($companyID <= 0)
	{
		throw new Main\ArgumentException('Must be greater than zero', 'companyID');
	}

	$dbResult = Main\Application::getConnection()->query(
		/** @lang text*/
		"SELECT CONTACT_ID FROM b_crm_contact_company WHERE COMPANY_ID = {$companyID} ORDER BY CONTACT_ID ASC"
	);

	$results = array();
	while($ary = $dbResult->fetch())
	{
		$results[] = (int)$ary['CONTACT_ID'];
	}
	return $results;
}