• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/exchange/integration/controller/statistic.php
  • Класс: BitrixSaleExchangeIntegrationControllerStatistic
  • Вызов: Statistic::modifyAction
public function modifyAction(array $fields)
{
	$statistics = $fields['STATISTICS'];
	$providerId = $fields['PROVIDER']['ID'];

	$r = $this->checkPackageLimit($statistics);
	if($r->isSuccess())
	{
		$r = $this->checkProviderById($providerId);
		if($r->isSuccess() === false)
		{
			$this->addErrors($r->getErrors());
			return null;
		}

		$statistics = $this->onBeforeModify($providerId, $statistics);

		$entityTable = $this->getEntityTable();
		$r = $entityTable::modify($statistics);
		if($r->isSuccess())
		{
			$this->onAfterModify($providerId);

			$provider = new B24IntegrationStatProviderTable();

			return [
				'ITEMS' => [
					'PROVIDER' => $provider::getRow(['filter'=>['ID'=>$providerId]]),
				]
			];
		}
	}

	$this->addErrors($r->getErrors());
	return null;
}