CCrmExternalSaleImport::DataSync

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmExternalSaleImport
  4. DataSync
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_external_sale_import.php
  • Класс: \CCrmExternalSaleImport
  • Вызов: CCrmExternalSaleImport::DataSync
static function DataSync($id)
{
	global $USER;
	if(!(isset($USER) && ((get_class($USER) === 'CUser') || ($USER instanceof CUser))))
	{
		$USER = new CUser();
	}

	if (\Bitrix\Crm\Restriction\RestrictionManager::getIntegrationShopRestriction()->isExceeded())
	{
		return '';
	}

	$id = intval($id);

	$i = new CCrmExternalSaleImport($id);
	if ($i->IsInitialized())
	{
		if ($i->arExternalSale == null)
			$i->arExternalSale = CCrmExternalSale::GetDefaultSettings($id);

		if ($i->arExternalSale["LABEL"] != "")
			$i->SyncOrderData(false, false);

		if ($i->arExternalSale["ERRORS"] > 10)
		{
			$i->NotifyError();
			return;
		}

		return "CCrmExternalSaleImport::DataSync(".$id.");";
	}
}

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