• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/location/external.php
  • Класс: BitrixSaleLocationExternalTable
  • Вызов: ExternalTable::addMultipleForOwner
static function addMultipleForOwner($primaryOwner, $external = array())
{
	$primaryOwner = Assert::expectIntegerPositive($primaryOwner, '$primaryOwner');

	// nothing to connect to, simply exit
	if(!is_array($external) || empty($external))
		return false;

	foreach($external as $data)
	{
		$serivceId = intval($data['SERVICE_ID']);

		if($serivceId && mb_strlen($data['XML_ID']))
		{
			$res = self::add(array(
				'SERVICE_ID' => $serivceId,
				'XML_ID' => $data['XML_ID'],
				'LOCATION_ID' => $primaryOwner
			));
			if(!$res->isSuccess())
				throw new MainSystemException(Loc::getMessage('SALE_LOCATION_EXTERNAL_ENTITY_CANNOT_ADD_DATA_EXCEPTION')); // .': '.implode(', ', $res->getErrorMessages())
		}
	}

        return true;
}