webCOMAND

User::get_full_name()

Get the closest thing to a "full name" for a User based on which fields are defined.

Prototype

string get_full_name()

Return

A string based on the defined fields with the following preference:

  1. If a First Name and Last Name is defined, combine them, separated by a space.
  2. If only a First Name is defined, return it.
  3. If only a Last Name is defined, return it.
  4. If a Username is defined, return it.
  5. If an Email is defined, return it.
  6. If none of the above are defined, return an empty string.

Example

$users = $repo->get("FROM User WHERE Email!=''");
foreach($users as $user) {
	echo($user->get_full_name() . "\n" );
}

Related

get_initials()