112 $fieldsInfo = empty($fieldsInfo)? $this->
getFields():$fieldsInfo;
113 $listFieldsInfoAdd = $this->getListFieldInfo($fieldsInfo, [
'filter'=>[
'ignoredAttributes'=>[Attributes::HIDDEN, Attributes::READONLY],
'ignoredFields'=>[
'PRODUCT_ID']]]);
114 $listFieldsInfoUpdate = $this->getListFieldInfo($fieldsInfo, [
'filter'=>[
'ignoredAttributes'=>[Attributes::HIDDEN, Attributes::READONLY, Attributes::IMMUTABLE],
'skipFields'=>[
'ID']]]);
116 if(isset($fields[
'PRODUCT'][
'ID']))
117 $result[
'PRODUCT'][
'ID'] = (int)$fields[
'PRODUCT'][
'ID'];
119 if(isset($fields[
'PRODUCT'][
'PRICES']))
121 foreach ($fields[
'PRODUCT'][
'PRICES'] as $k=>$item)
123 $result[
'PRODUCT'][
'PRICES'][$k] = $this->internalizeFields($item,
124 $this->isNewItem($item)? $listFieldsInfoAdd:$listFieldsInfoUpdate
177 $listFieldsInfoAdd = $this->getListFieldInfo($this->
getFields(), [
'filter'=>[
'ignoredAttributes'=>[Attributes::HIDDEN, Attributes::READONLY],
'ignoredFields'=>[
'PRODUCT_ID']]]);
178 $listFieldsInfoUpdate = $this->getListFieldInfo($this->
getFields(), [
'filter'=>[
'ignoredAttributes'=>[Attributes::HIDDEN, Attributes::READONLY, Attributes::IMMUTABLE]]]);
180 foreach ($fields[
'PRODUCT'][
'PRICES'] as $k=>$item)
182 $required = $this->checkRequiredFields($item,
183 $this->isNewItem($item)? $listFieldsInfoAdd:$listFieldsInfoUpdate
185 if(!$required->isSuccess())
187 $r->addError(
new Error(
'[prices]['.$k.
'] - '.implode(
', ', $required->getErrorMessages()).
'.'));