• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/v2/Price/PriceCollection.php
  • Класс: BitrixCatalogv2PricePriceCollection
  • Вызов: PriceCollection::setValues
public function setValues(array $values): self
{
	$preparedValues = $this->prepareValues($values);

	foreach ($preparedValues as $id => $fields)
	{
		$price = $this->findByGroupId($id);

		if ($price === null)
		{
			// ToDo make all collections with factory methods?
			$price = $this->create()->setGroupId($id);
		}

		if ($price)
		{
			$price->setPrice($fields['PRICE'] ?? null);

			if (isset($fields['CURRENCY']))
			{
				$price->setCurrency($fields['CURRENCY']);
			}
		}
	}

	return $this;
}