• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/businessvalue.php
  • Класс: BitrixSaleBusinessValue
  • Вызов: BusinessValue::changeConsumerKey
static function changeConsumerKey($fromConsumerKey, $toConsumerKey)
{
	if (! ($fromConsumerKey && $toConsumerKey))
		throw new SystemException('Empty consumer key!');

	if ($fromConsumerKey == $toConsumerKey)
		return;

	self::getConsumers(); // preload consumers

	if (! isset(self::$consumers[$fromConsumerKey]))
		throw new SystemException('There is no consumer "'.$fromConsumerKey.'" to change key!');

	if (isset(self::$consumers[$toConsumerKey]))
		throw new SystemException('Cannot change to consumer key "'.$toConsumerKey.'", as it already exists!');

	// TODO change common consumer code['CONSUMERS']
	self::$consumers[$toConsumerKey] = & self::$consumers[$fromConsumerKey]; // by ref!
	unset(self::$consumers[$fromConsumerKey]);
}