• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/helpers/order/builder/orderbuilder.php
  • Класс: BitrixSaleHelpersOrderBuilderOrderBuilder
  • Вызов: OrderBuilder::buildProfile
public function buildProfile()
{
	if (empty($this->formData["PROPERTIES"]) || empty($this->formData["USER_ID"]))
	{
		return $this;
	}

	$profileId = $this->formData["USER_PROFILE"]["ID"] ?? 0;
	$profileName = $this->formData["USER_PROFILE"]["NAME"] ?? '';

	$errors = [];
	CSaleOrderUserProps::DoSaveUserProfile(
		$this->getUserId(),
		$profileId,
		$profileName,
		$this->order->getPersonTypeId(),
		$this->formData["PROPERTIES"],
		$errors
	);

	foreach ($errors as $error)
	{
		$this->errorsContainer->addError(new MainError($error['TEXT'], $error['CODE'], 'PROFILE'));
	}

	return $this;
}