Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
lib
unicaen
ldap
Commits
e6b7acef
Commit
e6b7acef
authored
Dec 01, 2016
by
Bertrand Gauthier
Browse files
Entité People: Ajout getNomComplet()
parent
2e7eafcc
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/UnicaenLdap/Entity/People.php
View file @
e6b7acef
...
...
@@ -55,6 +55,30 @@ class People extends Entity
];
/**
* Retourne le nom complet de cet individu LDAP.
*
* @param boolean $nomEnMajuscule Mettre le nom de famille en majuscules ?
* @param boolean $avecCivilite Inclure la civilité ?
* @param boolean $prenomDabord Mettre le prénom avant le nom de famille ?
* @return string
*/
public
function
getNomComplet
(
$nomEnMajuscule
=
false
,
$avecCivilite
=
false
,
$prenomDabord
=
false
)
{
$sn
=
$this
->
get
(
'sn'
);
$sn
=
is_array
(
$sn
)
?
current
(
$sn
)
:
$sn
;
if
(
!
$sn
)
{
return
''
;
}
$nom
=
$nomEnMajuscule
?
strtoupper
(
$sn
)
:
$sn
;
$prenom
=
$this
->
get
(
'givenname'
);
$civilite
=
$avecCivilite
?
' '
.
$this
->
get
(
'supannCivilite'
)
:
null
;
return
(
$prenomDabord
?
$prenom
.
' '
.
$nom
:
$nom
.
' '
.
$prenom
)
.
$civilite
;
}
/**
* Détermine si l'individu est actif ou non
*
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment