You are here

private function ItemHistory::formatUser in Library 8

Format user name.

Parameters

mixed $idField: User to render by uid.

Return value

string Render array.

1 call to ItemHistory::formatUser()
ItemHistory::showHistoryForItem in src/Controller/ItemHistory.php
History for one item.

File

src/Controller/ItemHistory.php, line 142

Class

ItemHistory
Item history controller.

Namespace

Drupal\library\Controller

Code

private function formatUser($idField) {
  $name = '';
  if ($idField) {
    if ($idField
      ->getValue()) {
      $user = User::load($idField
        ->getValue()[0]['target_id']);
      if ($user) {
        $name = $user
          ->getDisplayName();
      }
    }
  }
  return $name;
}