• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/internals/notification/usecase/taskpingsent.php
  • Класс: BitrixTasksInternalsNotificationUseCaseTaskPingSent
  • Вызов: TaskPingSent::execute
public function execute(int $authorId, $params = []): bool
{
	$sender = $this->userRepository->getUserById($authorId);
	if (!$sender)
	{
		return false;
	}

	$recepients = $this->userRepository->getRecepients($this->task, $sender, $params);
	if (empty($recepients))
	{
		return false;
	}

	foreach ($this->providers as $provider)
	{
		foreach ($recepients as $recepient)
		{
			$provider->addMessage(new Message(
				$sender,
				$recepient,
				new Metadata(
					EntityCode::CODE_TASK,
					EntityOperation::PING_STATUS,
					[
						'task' => $this->task
					]
				)
			));
		}

		$this->buffer->addProvider($provider);
	}

	return true;
}