|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function getUsername(User $user, $withType = false): string |
|
|
public function getUsername(User $user, $withType = false): string |
|
|
{ |
|
|
{ |
|
|
if (isset($user->name_legal_person) && strlen($user->name_legal_person)) { |
|
|
|
|
|
|
|
|
if ($this->isTypeLegalPerson($user) |
|
|
|
|
|
&& isset($user->name_legal_person) |
|
|
|
|
|
&& strlen($user->name_legal_person)) { |
|
|
|
|
|
|
|
|
$username = $user->name_legal_person; |
|
|
$username = $user->name_legal_person; |
|
|
} else { |
|
|
} else { |
|
|
$username = $user->lastname . ' ' . $user->name; |
|
|
$username = $user->lastname . ' ' . $user->name; |