Commit e4dfcb8d by Damien Moulard

export data script: small fixes

parent 0667e5b0
...@@ -11,6 +11,7 @@ use Symfony\Component\Console\Output\OutputInterface; ...@@ -11,6 +11,7 @@ use Symfony\Component\Console\Output\OutputInterface;
use App\Entity\Adherent; use App\Entity\Adherent;
use App\Entity\Prestataire; use App\Entity\Prestataire;
use App\Entity\Flux; use App\Entity\Flux;
use App\Entity\Comptoir;
class ExportAndUploadDataCommand extends Command class ExportAndUploadDataCommand extends Command
{ {
...@@ -50,6 +51,7 @@ class ExportAndUploadDataCommand extends Command ...@@ -50,6 +51,7 @@ class ExportAndUploadDataCommand extends Command
$data = [ $data = [
"adherents" => [], "adherents" => [],
"prestataires" => [], "prestataires" => [],
"comptoirs" => [],
"flux" => [], "flux" => [],
]; ];
...@@ -88,6 +90,7 @@ class ExportAndUploadDataCommand extends Command ...@@ -88,6 +90,7 @@ class ExportAndUploadDataCommand extends Command
$prestataires = $this->em->getRepository(Prestataire::class)->findAllForSsaExport(); $prestataires = $this->em->getRepository(Prestataire::class)->findAllForSsaExport();
foreach ($prestataires as $p) { foreach ($prestataires as $p) {
$presta = [ $presta = [
"id" => $p->getId(),
"raison" => $p->getRaison(), "raison" => $p->getRaison(),
"addresses" => [], "addresses" => [],
"rubrics" => [], "rubrics" => [],
...@@ -111,6 +114,14 @@ class ExportAndUploadDataCommand extends Command ...@@ -111,6 +114,14 @@ class ExportAndUploadDataCommand extends Command
$data["prestataires"][] = $presta; $data["prestataires"][] = $presta;
} }
$comptoirs = $this->em->getRepository(Comptoir::class)->findAll();
foreach ($comptoirs as $c) {
$data["comptoirs"][] = [
"id" => $c->getId(),
"name" => $c->getName(),
];
}
$flux = $this->em->getRepository(Flux::class)->findAll(); $flux = $this->em->getRepository(Flux::class)->findAll();
foreach ($flux as $f) { foreach ($flux as $f) {
......
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