You are here

public function ChecklistapiChecklist::getLastUpdatedUser in Checklist API 8

Gets the name of the last user to update the checklist.

Return value

string The themed name of the last user to update the checklist, 'n/a' if there is no saved progress, or '[missing user] if the user no longer exists.

File

src/ChecklistapiChecklist.php, line 174

Class

ChecklistapiChecklist
Defines the checklist class.

Namespace

Drupal\checklistapi

Code

public function getLastUpdatedUser() {
  if (!isset($this->savedProgress['#changed_by'])) {
    return t('n/a');
  }
  $user = User::load($this->savedProgress['#changed_by']);
  return $user ? $user
    ->getAccountName() : t('[missing user]');
}