CAllCrmLead::GetAssociatedIDs

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CAllCrmLead
  4. GetAssociatedIDs
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_lead.php
  • Класс: \CAllCrmLead
  • Вызов: CAllCrmLead::GetAssociatedIDs
static function GetAssociatedIDs($entityTypeID, $entityID)
{
	$results = array();
	$dbResult = null;
	if($entityTypeID === CCrmOwnerType::Contact)
	{
		$dbResult = self::GetListEx(
			array(),
			array('=CONTACT_ID' => $entityID, 'CHECK_PERMISSIONS' => 'N'),
			false,
			false,
			array('ID')
		);
	}
	elseif($entityTypeID === CCrmOwnerType::Company)
	{
		$dbResult = self::GetListEx(
			array(),
			array('=COMPANY_ID' => $entityID, 'CHECK_PERMISSIONS' => 'N'),
			false,
			false,
			array('ID')
		);
	}

	if(is_object($dbResult))
	{
		while($fields = $dbResult->Fetch())
		{
			$results[] = (int)$fields['ID'];
		}
	}
	return $results;
}

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