• Модуль: imopenlines
  • Путь к файлу: ~/bitrix/modules/imopenlines/lib/integrations/report/statistics/manager.php
  • Класс: BitrixImOpenLinesIntegrationsReportStatisticsManager
  • Вызов: Manager::writeToStatistics
static function writeToStatistics($statisticKey, array $params)
{
	$map = self::getAggregateManagersMap();
	if (!empty($map[$statisticKey]))
	{
		/** @var AggregateStrategy $aggregator */
		$aggregator = new $map[$statisticKey]($params);
		if ($aggregator instanceof AggregateStrategy)
		{
			if (!$aggregator->getErrors())
			{
				if ($existingRecord = $aggregator->getExistingRecordByPrimary())
				{
					$aggregator->updateRecord($existingRecord);
				}
				else
				{
					$aggregator->createRecord();
				}
			}
		}
	}
}