• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/internals/notification/usecase/taskexpired.php
  • Класс: BitrixTasksInternalsNotificationUseCaseTaskExpired
  • Вызов: TaskExpired::expiredForAuditors
private function expiredForAuditors(User $sender, ProviderInterface $provider): void
{
	$accomplices = $this->task->getAccompliceMembersIds();

	foreach ($this->task->getAuditorMembersIds() as $auditorId)
	{
		if (
			$auditorId === $this->task->getCreatedBy()
			|| $auditorId === $this->task->getResponsibleId()
			|| in_array($auditorId, $accomplices)
		)
		{
			continue;
		}

		$recepient = $this->userRepository->getUserById($auditorId);
		if (!$recepient)
		{
			continue;
		}

		$provider->addMessage(new Message(
			$sender,
			$recepient,
			$this->getMetadata([
				'task' => $this->task,
				'member_code' => RoleDictionary::ROLE_AUDITOR
			])
		));
	}
}