User::getClientDataByFields

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. User
  4. getClientDataByFields
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/webform/embed/user.php
  • Класс: Bitrix\Crm\WebForm\Embed\User
  • Вызов: User::getClientDataByFields
static function getClientDataByFields($fields, ?int $presetId): array
{
	$result = [];
	if (!is_array($fields))
	{
		return $result;
	}

	if ($fields['CONTACT_ID'])
	{
		$typeId = \CCrmOwnerType::Contact;
		$entityId = $fields['CONTACT_ID'];
		$result += self::getEntityFields(new Identificator\Complex(
			$typeId,
			$entityId
		), $presetId);

		$result += self::loadReqData($typeId, $entityId, $presetId);
	}

	if ($fields['COMPANY_ID'])
	{
		$typeId = \CCrmOwnerType::Company;
		$entityId = $fields['COMPANY_ID'];
		$result += self::getEntityFields(new Identificator\Complex(
			$typeId,
			$entityId
		), $presetId);

		$result += self::loadReqData($typeId, $entityId, $presetId);
	}

	return $result;
}

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