• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/tradingplatform/ebay/api/entity.php
  • Класс: Bitrix\Sale\TradingPlatform\Ebay\Api\Entity
  • Вызов: Entity::__construct
public function __construct($siteId)
{
	if(!isset($siteId))
		throw new ArgumentNullException("siteId");

	$this->siteId = $siteId;
	$ebay = \Bitrix\Sale\TradingPlatform\Ebay\Ebay::getInstance();
	$settings = $ebay->getSettings();

	if(empty($settings[$siteId]["API"]["SITE_ID"]))
		throw new SystemException(Loc::getMessage('SALE_EBAY_ENTITY_SETTINGS_EMPTY', array('#SITE_ID#' => $siteId)));

	if(empty($settings[$siteId]["API"]["SITE_ID"]))
		throw new ArgumentNullException(Loc::getMessage('SALE_EBAY_ENTITY_TOKEN_EMPTY', array('#SITE_ID#' => $siteId)));

	$this->ebaySiteId = $settings[$siteId]["API"]["SITE_ID"];
	$this->authToken = $settings[$siteId]["API"]["AUTH_TOKEN"];
	$this->apiCaller = new Caller( array(
		"EBAY_SITE_ID" => $settings[$siteId]["API"]["SITE_ID"],
		"URL" => $ebay->getApiUrl(),
	));
}