Commit 2fce249f authored by Cédric Girardot's avatar Cédric Girardot

Feat : Ajoute date de décès dans l'import des individus

Change-Id: I64a279f1d8a7f5a4bd4cd7853c6f8769dab27f4d
parent 3b4cc586
...@@ -129,6 +129,7 @@ class ImportCommand extends Command ...@@ -129,6 +129,7 @@ class ImportCommand extends Command
$array_value['mail_mdr'] = trim($contentFileLineDetail[11]); $array_value['mail_mdr'] = trim($contentFileLineDetail[11]);
$array_value['libelle'] = trim($contentFileLineDetail[12]); $array_value['libelle'] = trim($contentFileLineDetail[12]);
$array_value['code'] = trim($contentFileLineDetail[13]); $array_value['code'] = trim($contentFileLineDetail[13]);
$array_value['date_deces'] = trim($contentFileLineDetail[14]);
try { try {
$this->addIndividu($array_value); $this->addIndividu($array_value);
...@@ -182,6 +183,7 @@ class ImportCommand extends Command ...@@ -182,6 +183,7 @@ class ImportCommand extends Command
$individu = new Person(); $individu = new Person();
$cr_date = new \DateTime($this->convertDate($array_value['date_naissance'])); $cr_date = new \DateTime($this->convertDate($array_value['date_naissance']));
$deathDate = $array_value['date_deces'] ? new \DateTime($this->convertDate($array_value['date_deces'])) : null;
$individu $individu
->setPersonNum($array_value['num_ind']) ->setPersonNum($array_value['num_ind'])
...@@ -197,7 +199,8 @@ class ImportCommand extends Command ...@@ -197,7 +199,8 @@ class ImportCommand extends Command
->setDepartmentalHouseMail($array_value['mail_mdr']) ->setDepartmentalHouseMail($array_value['mail_mdr'])
->setPhone($array_value['telephone']) ->setPhone($array_value['telephone'])
->setLabel($array_value['libelle']) ->setLabel($array_value['libelle'])
->setHelpCode($array_value['code']); ->setHelpCode($array_value['code'])
->setDeathDate($deathDate);
$entityManager->persist($individu); $entityManager->persist($individu);
$entityManager->flush(); $entityManager->flush();
......
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