• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/delivery/services/base.php
  • Класс: BitrixSaleDeliveryServicesBase
  • Вызов: Base::prepareFieldsForSaving
public function prepareFieldsForSaving(array $fields)
{
	$strError = "";
	$structure = $fields["CLASS_NAME"]::getConfigStructure();

	foreach($structure as $key1 => $rParams)
	{
		foreach($rParams["ITEMS"] as $key2 => $iParams)
		{
			if ($iParams["TYPE"] == "DELIVERY_SECTION")
			{
				continue;
			}

			$value = $fields["CONFIG"][$key1][$key2] ?? null;

			$errors = BitrixSaleInternalsInputManager::getRequiredError($iParams, $value);

			if (empty($errors))
			{
				$errors = BitrixSaleInternalsInputManager::getError($iParams, $value);
			}

			if (!empty($errors))
			{
				$strError .= Loc::getMessage("SALE_DLVR_BASE_FIELD")." "".$iParams["NAME"]."": ".implode("
n", $errors)."
n"; } } } if ($strError != "") { throw new SystemException($strError); } if(mb_strpos($fields['CLASS_NAME'], '\') !== 0) { $fields['CLASS_NAME'] = '\'.$fields['CLASS_NAME']; } return $fields; }