|
|
@@ -61,22 +61,6 @@ class UserSolver extends AbstractService implements SolverInterface |
|
|
|
return $user->type == User::TYPE_GUEST; |
|
|
|
} |
|
|
|
|
|
|
|
public function getUsernameFromArray(array $modelArray, $withType = false): string |
|
|
|
{ |
|
|
|
$username = ''; |
|
|
|
if (isset($modelArray['name_legal_person']) && strlen($modelArray['name_legal_person'])) { |
|
|
|
$username = $modelArray['name_legal_person']; |
|
|
|
} else { |
|
|
|
$username = $modelArray['lastname'] . ' ' . $modelArray['name']; |
|
|
|
} |
|
|
|
|
|
|
|
if ($withType && $modelArray['type'] == User::TYPE_LEGAL_PERSON) { |
|
|
|
$username = $username . ' (personne morale)'; |
|
|
|
} |
|
|
|
|
|
|
|
return $username; |
|
|
|
} |
|
|
|
|
|
|
|
public function getContactSummaryFromArrayAsHtml(array $user): string |
|
|
|
{ |
|
|
|
$html = ''; |
|
|
@@ -107,7 +91,25 @@ class UserSolver extends AbstractService implements SolverInterface |
|
|
|
$username = $user->lastname . ' ' . $user->name; |
|
|
|
} |
|
|
|
|
|
|
|
if ($withType) { |
|
|
|
if ($withType && $this->isTypeLegalPerson($user)) { |
|
|
|
$username = $username . ' (personne morale)'; |
|
|
|
} |
|
|
|
|
|
|
|
return $username; |
|
|
|
} |
|
|
|
|
|
|
|
public function getUsernameFromArray(array $modelArray, $withType = false): string |
|
|
|
{ |
|
|
|
$username = ''; |
|
|
|
if ($modelArray['type'] == User::TYPE_LEGAL_PERSON |
|
|
|
&& isset($modelArray['name_legal_person']) |
|
|
|
&& strlen($modelArray['name_legal_person'])) { |
|
|
|
$username = $modelArray['name_legal_person']; |
|
|
|
} else { |
|
|
|
$username = $modelArray['lastname'] . ' ' . $modelArray['name']; |
|
|
|
} |
|
|
|
|
|
|
|
if ($withType && $modelArray['type'] == User::TYPE_LEGAL_PERSON) { |
|
|
|
$username = $username . ' (personne morale)'; |
|
|
|
} |
|
|
|
|