LeadContactTable::getLeadBindings

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. LeadContactTable
  4. getLeadBindings
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/binding/leadcontact.php
  • Класс: Bitrix\Crm\Binding\LeadContactTable
  • Вызов: LeadContactTable::getLeadBindings
static function getLeadBindings($leadID)
{
	$leadID = (int)$leadID;
	if($leadID <= 0)
	{
		throw new Main\ArgumentException('Must be greater than zero', 'leadID');
	}

	$dbResult = Main\Application::getConnection()->query(
	/** @lang text*/
		"SELECT CONTACT_ID, SORT, ROLE_ID, IS_PRIMARY FROM b_crm_lead_contact WHERE LEAD_ID = {$leadID} ORDER BY SORT"
	);

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

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