Permalink
Browse files

refactored while adding new method

  • Loading branch information...
juergmessmer committed Nov 6, 2012
1 parent 0f95eb1 commit 6710501587324d3164e355c2ca097d6b941159a3
Showing with 12 additions and 6 deletions.
  1. +12 −6 lib/model/User.php
@@ -19,16 +19,22 @@ class User extends BaseUser {
const IS_ADMIN_USER = 'user-admin';
public function getFullName() {
if($this->getFirstName() && $this->getLastName()) {
return $this->getFirstName(). ' '.$this->getLastName();
}
return implode(' ', $this->getFullNameArray());
}
public function getFullNameInverted($sSeparator=', ') {
return implode($sSeparator=', ', array_reverse($this->getFullNameArray()));
}
public function getFullNameArray() {
$aResult = array();
if($this->getFirstName()) {
return $this->getFirstName();
$aResult[] = $this->getFirstName();
}
if($this->getLastName()) {
return $this->getLastName();
$aResult[] = $this->getLastName();
}
return $this->getUsername();
return $aResult;
}
public function getInitials() {

0 comments on commit 6710501

Please sign in to comment.