• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/counter/aggregatecounter.php
  • Класс: Bitrix\Crm\Counter\AggregateCounter
  • Вызов: AggregateCounter::__construct
public function __construct($code, array $data, $userID = 0)
{
	$this->code = $code;
	$this->counters  = array();
	foreach($data as $item)
	{
		$entityTypeID = (int)$item['entityTypeID'];
		$counterTypeID = (int)$item['counterTypeID'];
		$this->setUserID($userID > 0 ? $userID : \CCrmSecurityHelper::GetCurrentUserID());
		$extras = isset($item['extras']) && is_array($item['extras']) ? $item['extras'] : null;

		$this->counters[] = EntityCounterFactory::create(
			$entityTypeID,
			$counterTypeID,
			$this->getUserID(),
			$extras
		);
	}
}