• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/controller/property.php
  • Класс: BitrixSaleControllerProperty
  • Вызов: Property::saveProperty
protected function saveProperty()
{
	if ($this->property['TYPE'] === 'FILE')
	{
		$savedFiles = $this->saveFiles($this->property);
	}
	else
	{
		$savedFiles = [];
	}

	$propertiesToSave = [];

	foreach ($this->propertySettings as $name => $input)
	{
		$inputValue = Manager::getValue($input, $this->property[$name]);

		if ($name === 'DEFAULT_VALUE' || $inputValue !== null)
		{
			$propertiesToSave[$name] = $inputValue;
		}
	}

	$inputSettings = $this->getInputSettings($this->property);
	$propertiesToSave['SETTINGS'] = array_intersect_key($propertiesToSave, $inputSettings);
	$propertiesToSave = array_diff_key($propertiesToSave, $propertiesToSave['SETTINGS']);

	if (!empty($this->property['ID']))
	{
		$this->initializeDbProperty($this->property['ID']);
	}

	if (!empty($this->property['ID']))
	{
		$this->updateProperty($propertiesToSave);
	}
	else
	{
		$this->property['ID'] = $this->addProperty($propertiesToSave);
	}

	$this->cleanUpFiles($savedFiles);

	if (!$this->hasErrors())
	{
		$this->saveVariants();
		$this->saveRelations();
	}
}