• Модуль: timeman
  • Путь к файлу: ~/bitrix/modules/timeman/lib/monitor/history/userlog.php
  • Класс: BitrixTimemanMonitorHistoryUserLog
  • Вызов: UserLog::record
static function record($history): array
{
	$date = new Date($history['dateLog'], 'Y-m-j');

	foreach ($history['historyPackage'] as $index => $entry)
	{
		$result = MonitorUserLogTable::add([
			'DATE_LOG' => $date,
			'USER_ID' => User::getCurrentUserId(),
			'PRIVATE_CODE' => $entry['privateCode'],
			'ENTITY_ID' => $entry['ENTITY_ID'],
			'TIME_SPEND' => $entry['time'],
			'DESKTOP_CODE' => $history['desktopCode'],
			'COMMENT' => $entry['comment'],
		]);

		$history['historyPackage'][$index]['USER_LOG_ID'] = $result->getId();
	}

	return $history;
}