• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/controller/property.php
  • Класс: BitrixSaleControllerProperty
  • Вызов: Property::addProperty
protected function addProperty($propertiesToSave)
{
	$propertyId = null;

	if(!isset($propertiesToSave['XML_ID']) && $propertiesToSave['XML_ID'] == '')
	{
		$propertiesToSave['XML_ID'] = BitrixSaleInternalsOrderPropsTable::generateXmlId();
	}

	$propertiesToSave['ENTITY_REGISTRY_TYPE'] = BitrixSaleRegistry::REGISTRY_TYPE_ORDER;
	$propertiesToSave['ENTITY_TYPE'] = $this->getEntityType();
	//
	$addResult = BitrixSaleInternalsOrderPropsTable::add($propertiesToSave);
	if ($addResult->isSuccess())
	{
		$propertyId = $addResult->getId();
	}
	else
	{
		foreach ($addResult->getErrorMessages() as $errorMessage)
		{
			$this->errors[] = $errorMessage;
		}
	}

	return $propertyId;
}