• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/V2/Controller/User.php
  • Класс: BitrixImV2ControllerUser
  • Вызов: User::getDepartmentAction
public function getDepartmentAction(EntityUserUser $user): ?array
{
	$department = $user->getDepartments()->filterExist()->getDeepest()->getAny();

	if ($department === null)
	{
		return null;
	}

	return $this->toRestFormat($department);
}