• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/helpers/admin/businessvalue.php
  • Класс: BitrixSaleHelpersAdminBusinessValueControl
  • Вызов: BusinessValueControl::getFilter
static function getFilter($filter)
{
	$filter =
		is_array($filter)
			? array_intersect_key($filter, array('CODE_KEY'=>1,'CONSUMER_KEY'=>1,'PROVIDER_KEY'=>1,'PROVIDER_VALUE'=>1))
			: array()
	;

	if (self::$consumerInput['OPTIONS'])
	{
		$value = $filter['CONSUMER_KEY'] ?? null;
		$filter['CONSUMER_KEY'] =
			! InputManager::getError(self::$consumerInput, $value)
				? InputManager::getValue(self::$consumerInput, $value)
				: key(self::$consumerInput['OPTIONS']) // REQUIRED
		;
	}

	if (is_array(self::$consumerCodeInput[$filter['CONSUMER_KEY']]))
	{
		$value = $filter['CODE_KEY'] ?? null;
		$filter['CODE_KEY'] =
			! InputManager::getError(self::$consumerCodeInput[$filter['CONSUMER_KEY']], $value)
				? InputManager::getValue(self::$consumerCodeInput[$filter['CONSUMER_KEY']], $value)
				: null
		;
	}


	// TODO null - personTypeId
	$value = $filter['PROVIDER_KEY'] ?? null;
	$filter['PROVIDER_KEY'] =
		! InputManager::getError(self::$personProviderInput[null], $value)
			? InputManager::getValue(self::$personProviderInput[null], $value)
			: null;

	// TODO null - personTypeId
	$value = $filter['PROVIDER_VALUE'] ?? null;
	$filter['PROVIDER_VALUE'] = $filter['PROVIDER_KEY']
		&& ! InputManager::getError(self::$personProviderValueInput[null][$filter['PROVIDER_KEY']], $value)
			? InputManager::getValue(self::$personProviderValueInput[null][$filter['PROVIDER_KEY']], $value)
			: null;

	return $filter;
}