• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/tradingplatform/ebay/maphelper.php
  • Класс: BitrixSaleTradingPlatformEbayMapHelper
  • Вызов: MapHelper::getMapEntityId
static function getMapEntityId($mapEntityCode)
{
	$result = 0;
	$ebay = Ebay::getInstance();

	$fields = array(
		"TRADING_PLATFORM_ID" => $ebay->getId(),
		"CODE" => $mapEntityCode
	);

	$catMapVarEntRes = MapEntityTable::getList(array(
		"filter" => $fields
	));

	if($arCatVarMapEnt = $catMapVarEntRes->fetch())
	{
		$result = $arCatVarMapEnt["ID"];
	}
	else
	{
		$addRes = MapEntityTable::add($fields);

		if($addRes->isSuccess())
			$result = $addRes->getId();
	}

	if($result <= 0)
		throw new SystemException("Can' t get map entity id for code: ".$mapEntityCode.".");

	return $result;
}