/** * get the display name for the user, if no specific display name is set it will fallback to the user id * * @return string */ public function getDisplayName() { if (!isset($this->displayName)) { $displayName = ''; if ($this->backend and $this->backend->implementsActions(\OC\User\Backend::GET_DISPLAYNAME)) { // get display name and strip whitespace from the beginning and end of it $backendDisplayName = $this->backend->getDisplayName($this->uid); if (is_string($backendDisplayName)) { $displayName = trim($backendDisplayName); } } if (!empty($displayName)) { $this->displayName = $displayName; } else { $this->displayName = $this->uid; } } return $this->displayName; }