Commit 96b504ea authored by Stefan Busemann's avatar Stefan Busemann

[BUGFIX] Make import compliant to strict mode

parent 8383c51c
......@@ -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);
......
......@@ -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;
}
/**
......
......@@ -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);
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment