StreamStatistics::initializeDemoData

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. StreamStatistics
  4. initializeDemoData
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/widget/data/activity/streamstatistics.php
  • Класс: Bitrix\Crm\Widget\Data\Activity\StreamStatistics
  • Вызов: StreamStatistics::initializeDemoData
public function initializeDemoData(array $data, array $params)
{
	$group = isset($params['group'])? mb_strtoupper($params['group']) : '';
	if($group === self::GROUP_BY_STREAM)
	{
		$streams = StatisticsStream::getDescriptions();

		$identityField = isset($data['identityField']) && $data['identityField'] !== ''
			? $data['identityField'] : 'STREAM_ID';

		$titleField = isset($data['titleField']) && $data['titleField'] !== ''
			? $data['titleField'] : 'STREAM';

		foreach($data['items'] as $k => $item)
		{
			$streamId = isset($item[$identityField]) ? $item[$identityField] : '';
			if($streamId !== '' && isset($streams[$streamId]))
			{
				$data['items'][$k][$titleField] = $streams[$streamId];
			}
		}
	}
	return $data;
}

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