• Модуль: timeman
  • Путь к файлу: ~/bitrix/modules/timeman/lib/monitor/history/history.php
  • Класс: BitrixTimemanMonitorHistoryHistory
  • Вызов: History::record
static function record(array $queue): bool
{
	if (!$queue)
	{
		return true;
	}

	foreach ($queue as $history)
	{
		if (is_array($history['historyPackage']))
		{
			$entities = self::getEntities($history);
			if ($entities)
			{
				$entitiesWithIds = Entity::record($entities);
				$history = self::addEntityIdsToHistory($entitiesWithIds, $history);
			}

			$history = UserLog::record($history);

			$comments = self::getComments($history);
			if ($comments)
			{
				Comment::record($comments);
			}

			$absence = self::getAbsence($history);
			if ($absence)
			{
				Absence::record($absence);
			}
		}

		//TODO: refactor, transfer only what is needed instead of the whole history
		if (is_array($history['chartPackage']))
		{
			UserChart::record($history);
		}

		if ($history['comment'] !== '')
		{
			ReportComment::record($history);
		}
	}

	return true;
}