public function LogEntry::formatUser in Ultimate Cron 8.2
Format user.
1 call to LogEntry::formatUser()
- LogEntry::formatInitMessage in src/
Logger/ LogEntry.php - Format initial message.
File
- src/
Logger/ LogEntry.php, line 188
Class
- LogEntry
- Class for Ultimate Cron log entries.
Namespace
Drupal\ultimate_cron\LoggerCode
public function formatUser() {
$username = t('anonymous') . ' (0)';
if ($this->uid) {
$user = User::load($this->uid);
$username = $user ? new FormattableMarkup('@username (@uid)', array(
'@username' => $user
->getDisplayName(),
'@uid' => $user
->id(),
)) : t('N/A');
}
return $username;
}