• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/controller/property.php
  • Класс: BitrixSaleControllerProperty
  • Вызов: Property::updateAction
public function updateAction($id, array $fields)
{
	$r = $this->exists($id);
	if($r->isSuccess())
	{
		$fillFields = $this->get($id);
		$fields['ID'] = $fillFields['ID'];
		$fields['TYPE'] = $fillFields['TYPE'];
		$fields['PROPS_GROUP_ID'] = $fillFields['PROPS_GROUP_ID'];
		$fields['PERSON_TYPE_ID'] = $fillFields['PERSON_TYPE_ID'];

		if(isset($fields['SETTINGS']))
		{
			$fields = array_merge($fields, $fields['SETTINGS']);
			unset($fields['SETTINGS']);
		}

		$r = $this->checkFileds($fields);

		if($r->isSuccess())
		{
			$this->personTypeId = $fields['PERSON_TYPE_ID'];
			$this->property = $fields;

			$this->initializePropertySettings();
			if ($this->validateProperty())
			{
				$this->saveProperty();
			}

			foreach ($this->errors as $error)
			{
				$r->addError(new Error($error, 200850000003));
			}
		}
	}

	if(!$r->isSuccess())
	{
		$this->addErrors($r->getErrors());
		return null;
	}
	else
	{
		return ['PROPERTY'=>$this->get($this->property['ID'])];
	}
}