175 if ($this->fields[
'TYPE'] ===
'FILE')
177 return Input\File::loadInfo($value);
179 elseif ($this->fields[
'TYPE'] ===
'ADDRESS' && Main\Loader::includeModule(
'location'))
181 if (is_array($value))
188 elseif (is_numeric($value))
195 $value = ($address instanceof
Address) ? $address->toArray() :
null;
197 elseif (is_string($value) && !empty($value))
205 $result = Main\Web\Json::decode(
206 Main\Text\Encoding::convertEncoding(
215 $result = (
new Address(LANGUAGE_ID))
223 elseif ($this->fields[
'TYPE'] ===
"STRING")
225 if ($this->fields[
'IS_EMAIL'] ===
"Y" && !empty($value))
227 $value = trim((
string)$value);
230 if (Input\StringInput::isMultiple($value))
232 foreach ($value as $key => $data)
291 $personTypeId = intval($personTypeId);
292 if ($personTypeId <= 0 || !is_array($request))
297 $dbRes = static::getList([
314 '=PERSON_TYPE_ID' => $personTypeId
318 while ($row = $dbRes->fetch())
320 if (array_key_exists($row[
"ID"], $request))
322 foreach ($row as $key => $value)
324 if (($value ===
"Y") && (mb_substr($key, 0, 3) ===
"IS_"))
326 $result[mb_substr($key, 3)] = $request[$row[
"ID"]];
449 $value = $propertyValue->getField(
'VALUE');
451 if ($this->
getType() ==
'FILE')
453 $value = Input\File::asMultiple($value);
455 foreach ($value as $i => $file)
457 if (Input\File::isDeletedSingle($file))
463 if (Input\File::isUploadedSingle($file))
465 $fileId = \CFile::SaveFile(array(
'MODULE_ID' =>
'sale') + $file,
'sale/order/properties');
466 if (is_numeric($fileId))
472 $value[$i] = Input\File::loadInfoSingle($file);
477 $propertyValue->setField(
'VALUE', $value);
478 $value = Input\File::getValue($property, $value);
480 $originalFields = $propertyValue->getFields()->getOriginalValues();
483 Input\File::asMultiple(Input\File::getValue($property, $originalFields[
'VALUE'])),
484 Input\File::asMultiple($value),
485 Input\File::asMultiple(Input\File::getValue($property, $property[
'DEFAULT_VALUE']))
490 \CFile::Delete($fileId);
493 elseif ($this->
getType() ===
'ADDRESS' && Main\Loader::includeModule(
'location'))
495 if (!is_array($value))
501 $result = $address->save();
502 if (!$result->isSuccess())
507 return (
int)$result->getId();