Methods
Method |
Parameters |
Parameter description |
Return |
Description |
|---|---|---|---|---|
getAvatarUrl |
- |
- |
string |
Returns the user's avatar image url. |
getDateFormat |
- |
- |
string |
Returns the user's date format as specified in their settings. If an invalid date format is configured, a default value of YYYY-MM-DD HH:mm:ss is returned. |
getDateFormatId |
- |
- |
int |
Returns the user's date format id. (see DateFormatterInterface constants) |
getDecimalSeparator |
- |
- |
string |
Returns the user's decimal separator. |
getDepartment |
- |
- |
string |
Returns the user's department. |
getEmail |
- |
- |
string |
Returns the user's e-mail address |
getFax |
- |
- |
string |
Returns the user's fax number. |
getFullName |
- |
- |
string |
Returns the complete name of the user in the form of "prename lastname". |
getJobFunctions |
- |
- |
string[] |
Returns the user's job functions. |
getLanguage |
- |
- |
string |
Returns the user's language. |
getLastName |
- |
- |
string |
Returns the last name of the user. |
getPhone |
- |
- |
string |
Returns the user's phone number. |
getPrename |
- |
- |
string |
Returns the user's first name (pre-name). |
getSupervisor |
- |
- |
string |
Returns the supervisor of the user. |
getThousandsSeparator |
- |
- |
string |
Returns the user's thousands separator. |
getTimezone |
- |
- |
string |
Returns the user's time zone. |
getUserDefined1 |
- |
- |
string |
Returns the first user-defined settings of the user. |
getUserDefined2 |
- |
- |
string |
Returns the second user-defined settings of the user. |
getUserDefined3 |
- |
- |
string |
Returns the third user-defined settings of the user. |
getUserDefined4 |
- |
- |
string |
Returns the fourth user-defined settings of the user. |
getUserDefined5 |
- |
- |
string |
Returns the fifth user-defined settings of the user. |
getUsername |
- |
- |
string |
Returns the login name for the user. |
getUserProfile |
- |
- |
int |
Returns the selected user's profile. |
hasAdminRights |
- |
- |
bool |
Checks whether the user has administration rights. |
hasOwnProcesses |
- |
- |
bool |
Checks whether the user is the owner of any processes. |
isBlocked |
- |
- |
bool |
Checks whether the user is blocked or not. |
isInJobFunction |
•$jobFunction: string |
•JobFunction name |
bool |
Checks whether the user is in the specified role. |
Example
<?php
use JobRouter\Sdk\UserManagerInterface;
return function (UserManagerInterface $userInterface): void {
echo '<h1 style="color: #fc0">JobRouter SDK user interface example!</h1>';
try {
$user = $userInterface->getCurrentUser();
echo '<h3 style="color: #59aa6e;">The user with username "' . $user->getUserName() . '" is authenticated!</h3>';
$fullName = $user->getFullName();
$inJobFunction = $user->isInJobFunction('Administrator') === true
? 'Yes'
: 'No';
echo '<pre>FullName: ' . print_r($fullName, true) . '</pre>';
echo '<pre>In JobFunctions (Administrator): ' . print_r($inJobFunction, true) . '</pre>';
} catch (\JobRouterException) {
echo '<h3 style="color: #f44;">The user is not authenticated!</h3>';
}
};
Response:
JobRouter SDK user interface example!
The user with username "admin" is authenticated!
FullName: Max Mustermann
In JobFunctions (Administrator): Yes