• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/location/location.php
  • Класс: BitrixSaleLocationLocationTable
  • Вызов: LocationTable::updateExtended
static function updateExtended($primary, array $data, array $additional = array())
{
	$primary = Assert::expectIntegerPositive($primary, '$primary');
	$resetLegacy = !isset($additional['RESET_LEGACY']) || $additional['RESET_LEGACY'] !== false;

	// first update parent, and if it succeed, do updates of the connected data

	if(isset($data['EXTERNAL']))
	{
		$external = $data['EXTERNAL'];
		unset($data['EXTERNAL']);
	}

	if(isset($data['NAME']))
	{
		$name = $data['NAME'];
		unset($data['NAME']);
	}

	// force code to lowercase
	if(isset($data['CODE']))
		$data['CODE'] = ToLower($data['CODE']);

	// you are not allowed to modify tree data over LocationTable::update()
	self::applyRestrictions($data);

	$updResult = parent::updateExtended($primary, $data, $additional);

	// update connected data
	if($updResult->isSuccess())
	{
		// external
		if(isset($external))
			ExternalTable::updateMultipleForOwner($primary, $external);

		// names
		if(isset($name))
			NameLocationTable::updateMultipleForOwner($primary, $name);

		if($resetLegacy && (intval($data['TYPE_ID']) > 0 || isset($data['PARENT_ID'])))
			self::resetLegacy(intval($data['TYPE_ID']));

		$GLOBALS['CACHE_MANAGER']->ClearByTag('sale-location-data');

		if(isset($name) || isset($data['PARENT_ID']))
			SearchFinder::setIndexInvalid();
	}

	return $updResult;
}