Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
octopus
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
lib
unicaen
octopus
Commits
81ffa22e
Commit
81ffa22e
authored
Feb 18, 2019
by
Jean-Philippe Metivier
Browse files
Options
Downloads
Patches
Plain Diff
Correction mineure et ajout de fonction de recherche
parent
80572f2a
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Octopus/Entity/Db/Mapping/Octopus.Entity.Db.Individu.dcm.xml
+3
-0
3 additions, 0 deletions
...opus/Entity/Db/Mapping/Octopus.Entity.Db.Individu.dcm.xml
src/Octopus/Service/Individu/IndividuService.php
+24
-1
24 additions, 1 deletion
src/Octopus/Service/Individu/IndividuService.php
with
27 additions
and
1 deletion
src/Octopus/Entity/Db/Mapping/Octopus.Entity.Db.Individu.dcm.xml
+
3
−
0
View file @
81ffa22e
...
...
@@ -24,6 +24,9 @@
<field
name=
"cCommuneNaissance"
type=
"string"
length=
"5"
column=
"C_COMMUNE_NAISSANCE"
nullable=
"false"
/>
<field
name=
"cDeptNaissance"
type=
"string"
length=
"3"
column=
"C_DEPT_NAISSANCE"
nullable=
"false"
/>
<field
name=
"cPaysNaissance"
type=
"string"
length=
"3"
column=
"C_PAYS_NAISSANCE"
nullable=
"false"
/>
<!--<many-to-one target-entity="Octopus\Entity\Db\Pays" field="cPaysNaissance">-->
<!--<join-column name="C_PAYS_NAISSANCE" referenced-column-name="CODE_PAYS" />-->
<!--</many-to-one>-->
<field
name=
"cPaysNationalite"
type=
"string"
length=
"3"
column=
"C_PAYS_NATIONALITE"
nullable=
"false"
/>
<field
name=
"telPersonnelle"
type=
"string"
length=
"20"
column=
"TEL_PERSO"
nullable=
"false"
/>
<field
name=
"emailPersonnelle"
type=
"string"
length=
"255"
column=
"EMAIL_PERSO"
nullable=
"false"
/>
...
...
This diff is collapsed.
Click to expand it.
src/Octopus/Service/Individu/IndividuService.php
+
24
−
1
View file @
81ffa22e
...
...
@@ -4,6 +4,7 @@ namespace Octopus\Service\Individu;
use
Doctrine\ORM\NonUniqueResultException
;
use
Octopus\Entity\Db\Individu
;
use
Octopus\Entity\Db\Source
;
use
UnicaenApp\Exception\RuntimeException
;
use
UnicaenApp\Service\EntityManagerAwareTrait
;
...
...
@@ -54,7 +55,7 @@ class IndividuService {
public
function
getIndividusByTerm
(
$term
,
$sourceCode
=
null
)
{
$qb
=
$this
->
getEntityManager
()
->
getRepository
(
Individu
::
class
)
->
createQueryBuilder
(
'individu'
)
->
addSelect
(
'source'
)
->
join
(
'individu.
s
ource'
,
'source'
)
->
addSelect
(
'source'
)
->
join
(
'individu.
cS
ource'
,
'source'
)
->
andWhere
(
'individu.nomUsage LIKE :search'
)
->
setParameter
(
'search'
,
'%'
.
$term
.
'%'
)
->
orderBy
(
'individu.nomUsage, individu.prenom'
)
...
...
@@ -68,4 +69,26 @@ class IndividuService {
$result
=
$qb
->
getQuery
()
->
getResult
();
return
$result
;
}
/**
* @param integer $numeroEtudiant
* @return Individu
*/
public
function
getEtudiantByNumero
(
$numeroEtudiant
)
{
$qb
=
$this
->
getEntityManager
()
->
getRepository
(
Individu
::
class
)
->
createQueryBuilder
(
'individu'
)
->
addSelect
(
'source'
)
->
join
(
'individu.cSource'
,
'source'
)
->
andWhere
(
'individu.cEtu = :numero'
)
->
andWhere
(
'source.cSource = :sourceCode'
)
->
setParameter
(
'numero'
,
$numeroEtudiant
)
->
setParameter
(
'sourceCode'
,
Source
::
SOURCE_APOGEE
)
;
try
{
$result
=
$qb
->
getQuery
()
->
getOneOrNullResult
();
}
catch
(
NonUniqueResultException
$e
)
{
throw
new
RuntimeException
(
"Plusieurs étudiants partagent le même numéro étudiant ["
.
$numeroEtudiant
.
"]."
,
$e
);
}
return
$result
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment