Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
services
t3o sites
voting.typo3.org
extensions
election
Commits
96b504ea
Commit
96b504ea
authored
Apr 02, 2020
by
Stefan Busemann
Browse files
[BUGFIX] Make import compliant to strict mode
parent
8383c51c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Classes/Controller/BeElectorController.php
View file @
96b504ea
...
...
@@ -172,6 +172,7 @@ class BeElectorController extends AbstractProtectedBeController
$elector
->
setLastName
(
$electorImport
->
getLastName
());
$elector
->
setGender
(
$electorImport
->
getGender
());
$elector
->
setEmail
(
$electorImport
->
getEmail
());
$elector
->
setElectionInvitations
(
0
);
$elector
->
addElectorate
(
$electorImport
->
getElectorate
());
$this
->
electorRepository
->
add
(
$elector
);
$this
->
electorImportRepository
->
remove
(
$electorImport
);
...
...
Classes/Domain/Model/Elector.php
View file @
96b504ea
...
...
@@ -73,7 +73,7 @@ class Elector extends AbstractPerson
*/
public
function
getElectionInvitations
()
{
return
$this
->
electionInvitations
;
return
$this
->
electionInvitations
??
0
;
}
/**
...
...
@@ -81,7 +81,7 @@ class Elector extends AbstractPerson
*/
public
function
setElectionInvitations
(
$electionInvitations
)
{
$this
->
electionInvitations
=
$electionInvitations
;
$this
->
electionInvitations
=
$electionInvitations
??
0
;
}
/**
...
...
Classes/Domain/Model/ElectorImport.php
View file @
96b504ea
...
...
@@ -52,6 +52,13 @@ class ElectorImport extends AbstractPerson
$this
->
setMiddleName
(
$importInformation
[
'middleName'
]);
$this
->
setLastName
(
$importInformation
[
'lastName'
]);
$this
->
setEmail
(
$importInformation
[
'email'
]);
$this
->
setGender
(
$importInformation
[
'gender'
]);
switch
(
$importInformation
[
'gender'
])
{
case
'Male'
:
$this
->
setGender
(
1
);
case
'Female'
:
$this
->
setGender
(
2
);
default
:
$this
->
setGender
(
0
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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