CAllCrmLead::createCompatibilityAdapter

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CAllCrmLead
  4. createCompatibilityAdapter
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_lead.php
  • Класс: \CAllCrmLead
  • Вызов: CAllCrmLead::createCompatibilityAdapter
static function createCompatibilityAdapter(): Bitrix\Crm\Entity\Compatibility\Adapter
{
	$factory = Crm\Service\Container::getInstance()->getFactory(\CCrmOwnerType::Lead);
	if (!$factory)
	{
		throw new Error('No factory for lead');
	}

	$compatibilityAdapter =
		(new Crm\Entity\Compatibility\Adapter\Operation($factory))
			->setRunAutomation(false)
			->setRunBizProc(false)
			->setAlwaysExposedFields([
				'ID',
				'MODIFY_BY_ID',
				'EXCH_RATE',
				'ACCOUNT_CURRENCY_ID',
				'OPPORTUNITY_ACCOUNT',
			])
			->setExposedOnlyAfterAddFields([
				'CREATED_BY_ID',
				'ASSIGNED_BY_ID',
				'OPPORTUNITY',
				'TITLE',
				'BIRTHDAY_SORT',
				'STATUS_ID',
				'STATUS_SEMANTIC_ID',
				'CURRENCY_ID',
				'HAS_IMOL',
				'HAS_PHONE',
				'HAS_EMAIL',
				'DATE_MODIFY',
				'DATE_CREATE',
			])
			->setExposedOnlyAfterUpdateFields([
				'FULL_NAME',
			])
	;

	$addressAdapter = new Crm\Entity\Compatibility\Adapter\Address(\CCrmOwnerType::Lead, EntityAddressType::Primary);
	$compatibilityAdapter->addChild($addressAdapter);

	return $compatibilityAdapter;
}

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