method
public
UserRepositoryInterface::getUserById()
Класс: \Bitrix\Tasks\Internals\Notification\UserRepositoryInterface
Сигнатура
public getUserById(int|null $userId) : User|null
Параметры
$userId
int|null
Возвращаемое значение
User|null
Как применяется в UserRepositoryInterface
UserRepositoryInterface::getUserById() — метод интерфейса \Bitrix\Tasks\Internals\Notification\UserRepositoryInterface модуля «Задачи».
Метод объекта: сначала нужен объект, реализующий UserRepositoryInterface.
use Bitrix\Main\Loader;
use Bitrix\Tasks\Internals\Notification\UserRepositoryInterface;
Loader::includeModule('tasks');
/** @var UserRepositoryInterface $object */
$userId = 1;
$result = $object->getUserById($userId);
// $result: User|nullДругие методы UserRepositoryInterface
getParticipants()Должен возвращать массив идентификаторов пользователей, участвующих в переданной задачеgetRecepients()Должен возвращать массив объектов Internals/Notification/User, участвующих в переданной задачеgetSender()getUsersByIds()getUserTimeZoneOffset()
getUserById() есть и у других классов модуля «Задачи»: UserRepository.
Исходный файл: source/tasks/lib/internals/notification/userrepositoryinterface.php:18

