Price::normalizeFields

  1. Bitrix24 API (v. 23.675.0)
  2. catalog
  3. Price
  4. normalizeFields
  • Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/controller/price.php
  • Класс: BitrixCatalogControllerPrice
  • Вызов: Price::normalizeFields
static function normalizeFields(array &$fields)
{
	if (isset($fields['QUANTITY_FROM']))
	{
		if (is_string($fields['QUANTITY_FROM']) && $fields['QUANTITY_FROM'] === '')
			$fields['QUANTITY_FROM'] = null;
		elseif ($fields['QUANTITY_FROM'] === false || $fields['QUANTITY_FROM'] === 0)
			$fields['QUANTITY_FROM'] = null;
	}
	else
	{
		$fields['QUANTITY_FROM'] = null;
	}

	if (isset($fields['QUANTITY_TO']))
	{
		if (is_string($fields['QUANTITY_TO']) && $fields['QUANTITY_TO'] === '')
			$fields['QUANTITY_TO'] = null;
		elseif ($fields['QUANTITY_TO'] === false || $fields['QUANTITY_TO'] === 0)
			$fields['QUANTITY_TO'] = null;
	}
	else
	{
		$fields['QUANTITY_TO'] = null;
	}

	if (isset($fields['EXTRA_ID']))
	{
		if (is_string($fields['EXTRA_ID']) && $fields['EXTRA_ID'] === '')
			$fields['EXTRA_ID'] = null;
		elseif ($fields['EXTRA_ID'] === false)
			$fields['EXTRA_ID'] = null;
	}
	else
	{
		$fields['EXTRA_ID'] = null;
	}
}

Добавить комментарий