UserOption::onOptionChanged

  1. Bitrix24 API (v. 23.675.0)
  2. tasks
  3. UserOption
  4. onOptionChanged
  • Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/internals/useroption.php
  • Класс: BitrixTasksInternalsUserOption
  • Вызов: UserOption::onOptionChanged
static function onOptionChanged(int $taskId, int $userId, int $option, bool $added): void
{
	if ($taskId <= 0 || $userId <= 0 || !static::isOption($option))
	{
		return;
	}

	if ($option === Option::MUTED)
	{
		CounterCounterService::addEvent(
			CounterEventEventDictionary::EVENT_AFTER_TASK_MUTE,
			[
				'TASK_ID' => $taskId,
				'USER_ID' => $userId,
				'ADDED' => $added
			]
		);
	}

	static::sendPushOptionChanged($taskId, $userId, $option, $added);

	$event = new MainEvent(
		'tasks',
		'onTaskUserOptionChanged',
		[
			'taskId' => $taskId,
			'userId' => $userId,
			'option' => $option,
			'added' => $added,
		]
	);
	$event->send();
}

Добавить комментарий