• Модуль: timeman
  • Путь к файлу: ~/bitrix/modules/timeman/lib/monitor/history/comment.php
  • Класс: BitrixTimemanMonitorHistoryComment
  • Вызов: Comment::remove
static function remove(int $userId, string $dateLog, string $desktopCode): Result
{
	$connection = Application::getConnection();
	$sqlHelper = $connection->getSqlHelper();

	$dateLog = $sqlHelper->forSql($dateLog);
	$desktopCode = $sqlHelper->forSql($desktopCode);

	$deleteCommentsQuery = "
		DELETE FROM b_timeman_monitor_comment WHERE USER_LOG_ID IN (
			SELECT ID
			FROM b_timeman_monitor_user_log
			WHERE DATE_LOG = '{$dateLog}' 
			  and USER_ID = {$userId} 
			  and DESKTOP_CODE = '{$desktopCode}'
		);
	";

	return $connection->query($deleteCommentsQuery);
}