method
public
UserRepositoryInterface::getSender()
Класс: \Bitrix\Tasks\Internals\Notification\UserRepositoryInterface
Сигнатура
public getSender(TaskObject $task[, array<string|int, mixed> $optional = [] ]) : User|null
Параметры
$task
TaskObject
$optional
array<string|int, mixed>
= []
Возвращаемое значение
User|null
Как применяется в UserRepositoryInterface
UserRepositoryInterface::getSender() — метод интерфейса \Bitrix\Tasks\Internals\Notification\UserRepositoryInterface модуля «Задачи».
Метод объекта: сначала нужен объект, реализующий UserRepositoryInterface.
use Bitrix\Main\Loader;
use Bitrix\Tasks\Internals\Notification\UserRepositoryInterface;
Loader::includeModule('tasks');
/** @var UserRepositoryInterface $object */
$task = null; // TaskObject
$result = $object->getSender($task);
// $result: User|nullДругие методы UserRepositoryInterface
getParticipants()Должен возвращать массив идентификаторов пользователей, участвующих в переданной задачеgetRecepients()Должен возвращать массив объектов Internals/Notification/User, участвующих в переданной задачеgetUserById()getUsersByIds()getUserTimeZoneOffset()
getSender() есть и у других классов модуля «Задачи»: CommentCreatedStrategy, FakeStrategy, Message, NotificationReplyStrategy, OnTaskFirstViewEvent, RecipientStrategyInterface, RegularTaskReplicatedStrategy, RegularTaskStartedStrategy.
Исходный файл: source/tasks/lib/internals/notification/userrepositoryinterface.php:17

