Price::modifyAction

  1. Bitrix24 API (v. 23.675.0)
  2. catalog
  3. Price
  4. modifyAction
  • Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/controller/price.php
  • Класс: BitrixCatalogControllerPrice
  • Вызов: Price::modifyAction
public function modifyAction(array $fields): ?array
{
	if (!is_array($fields['PRODUCT']['PRICES']))
	{
		$this->addError(new Error('Product prices are empty'));

		return null;
	}

	$r = $this->modifyValidate($fields['PRODUCT']['PRICES']);

	if ($r->isSuccess())
	{
		$r = $this->modifyBefore($fields);
		if($r->isSuccess())
		{
			$r = $this->modify($fields);
		}
	}

	if (!$r->isSuccess())
	{
		$this->addErrors($r->getErrors());

		return null;
	}

	$ids = $r->getData()[0];
	$entityTable = $this->getEntityTable();

	return [
		'PRICES' =>
			$entityTable::getList(
				['filter' => ['=ID' => $ids]]
			)
			->fetchAll()
	];
}

Добавить комментарий