• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/entitypropertyvalue.php
  • Класс: BitrixSaleEntityPropertyValue
  • Вызов: EntityPropertyValue::add
protected function add()
{
	$result = new Result();

	$value = $this->property->getPreparedValueForSave($this);
	/** @var PropertyValueCollection $collection */

	$res = $this->addInternal(
		[
			'ORDER_ID' => $this->getOrder()->getId(),
			'ORDER_PROPS_ID' => $this->property->getId(),
			'NAME' => $this->property->getName(),
			'VALUE' => $value,
			'CODE' => $this->property->getField('CODE'),
			'XML_ID' => $this->getField('XML_ID'),
			'ENTITY_ID' => $this->getCollection()->getEntityParentId(),
			'ENTITY_TYPE' => $this->getField('ENTITY_TYPE')
		]
	);

	if ($res->isSuccess())
	{
		$this->setFieldNoDemand('ID', $res->getId());
		$result->setId($res->getId());
	}
	else
	{
		$result->addErrors($res->getErrors());
	}

	return $result;
}