• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/integration/report/handler/salesperiodcompare/graphcurrent.php
  • Класс: Bitrix\Crm\Integration\Report\Handler\SalesPeriodCompare\GraphCurrent
  • Вызов: GraphCurrent::padNormalizedData
public function padNormalizedData(&$normalizedData)
{
	$filterParameters = $this->getFilterParameters();
	if(!isset($filterParameters['TIME_PERIOD']))
	{
		throw new SystemException(Loc::getMessage("CRM_REPORT_PERIOD_COMPARE_ERROR_TIME_PERIOD_UNSET"));
	}

	$minDate = new Date($filterParameters['TIME_PERIOD']['from']);

	reset($normalizedData);
	$firstKey = key($normalizedData);
	/** @var Date $maxDate */
	$maxDate = $normalizedData[$firstKey]['CLOSED'];

	foreach ($normalizedData as $key => $value)
	{
		/** @var Date $closedDate */
		$closedDate = $value['CLOSED'];
		if($closedDate->getTimestamp() > $maxDate->getTimestamp())
		{
			$maxDate = clone($closedDate);
		}
	}

	$this->fillDateGaps($normalizedData, $minDate, $maxDate);

	uasort($normalizedData, function($a, $b)
	{
		return $a['CLOSED']->getTimestamp() <=> $b['CLOSED']->getTimestamp();
	});
}