Methods
Method |
Parameters |
Parameter description |
Return |
Description |
|---|---|---|---|---|
getCurrentUser |
- |
- |
Returns the currently logged in user |
|
getUserByUsername |
•$userName: string |
•Name of the user |
Returns the UserInterface for the specified user name |
Example
<?php
use JobRouter\Sdk\UserManagerInterface;
return function (UserManagerInterface $userInterface): void {
echo '<h1 style="color: #fc0">JobRouter SDK user interface example!</h1>';
try {
$currentUser = $userInterface->getCurrentUser();
// Do something with the $currentUser
$userByName = $userInterface->getUserByUsername('example_user');
// Do something with the $userByName
} catch (\JobRouterException) {
echo '<h3 style="color: #f44;">The user does not exist!</h3>';
}
};