• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/comments/viewed/event.php
  • Класс: BitrixTasksCommentsViewedEvent
  • Вызов: Event::addByTypePushService
public function addByTypePushService(string $type, array $fields): void
{
	$role = $fields['ROLE'];
	$groupId = $fields['GROUP_ID'];
	$currentUserId = $fields['CURRENT_USER_ID'];

	if ($type == Enum::USER)
	{
		PushService::addEvent($currentUserId, [
			'module_id' => 'tasks',
			'command' => PushCommand::COMMENTS_VIEWED,
			'params' => [
				'USER_ID' => $currentUserId,
				'GROUP_ID' => $groupId,
				'ROLE' => $role,
			]
		]);
	}
	else if ($type == Enum::PROJECT)
	{
		PushService::addEvent($currentUserId, [
			'module_id' => 'tasks',
			'command' => PushCommand::PROJECT_COMMENTS_VIEWED,
			'params' => [
				'USER_ID' => $currentUserId,
				'GROUP_ID' => $groupId,
			]
		]);
	}
	else if ($type == Enum::SCRUM)
	{
		PushService::addEvent($currentUserId, [
			'module_id' => 'tasks',
			'command' => PushCommand::SCRUM_COMMENTS_VIEWED,
			'params' => [
				'USER_ID' => $currentUserId,
				'GROUP_ID' => $groupId,
			]
		]);
	}
}