• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/controller/propertygroups.php
  • Класс: BitrixSaleControllerPropertyGroups
  • Вызов: PropertyGroups::updateAction
public function updateAction($id, array $fields)
{
	global $APPLICATION;

	$orderPropsGroup = new CSaleOrderPropsGroup();

	$r = $this->exists($id);
	if($r->isSuccess())
	{
		if(isset($fields['PERSON_TYPE_ID']))
			unset($fields['PERSON_TYPE_ID']);

		if(!$orderPropsGroup->Update($id, $fields))
		{
			if ($ex = $APPLICATION->GetException())
				$r->addError(new Error($ex->GetString(), $ex->GetId()));
			else
				$r->addError(new Error(Loc::getMessage('CONTROLLER_ERROR_UPDATE_PROPS_GROUP', ['#ID#'=>$id]), 'ERROR_UPDATE_PROPS_GROUP'));
		}
	}

	if($r->isSuccess())
	{
		return ['PROPERTY_GROUP'=>$this->get($id)];
	}
	else
	{
		$this->addErrors($r->getErrors());
		return null;
	}
}