• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/v2/PropertyValue/PropertyValueCollection.php
  • Класс: BitrixCatalogv2PropertyValuePropertyValueCollection
  • Вызов: PropertyValueCollection::setValue
private function setValue($fields): void
{
	$entity = null;

	if ($this->isPropertyMultiple())
	{
		if (isset($fields['ID']) && $fields['ID'] > 0)
		{
			$entity = $this->findById($fields['ID']);
		}
	}
	else
	{
		$entity = !empty($this->items) ? reset($this->items) : null;
	}

	if ($entity === null)
	{
		$entity = $this->propertyValueFactory->createEntity();
		$this->add($entity);
	}

	$entity->setValue($fields['VALUE'] ?? null);

	if (isset($fields['DESCRIPTION']))
	{
		$entity->setDescription($fields['DESCRIPTION']);
	}
}