Fixtures/fix loading people

This commit is contained in:
2021-08-17 20:01:29 +00:00
parent 4cf676858e
commit c7cc2c7596
11 changed files with 453 additions and 434 deletions

View File

@@ -33,7 +33,7 @@ class LoadHousehold extends Fixture implements DependentFixtureInterface
public function load(ObjectManager $manager)
{
// generate two times the participation. This will lead to
// generate two times the participation. This will lead to
// some movement in participation (same people in two differents
// households)
@@ -110,7 +110,7 @@ class LoadHousehold extends Fixture implements DependentFixtureInterface
$i = 0;
while ($i < $nb) {
$address = $this->createAddress();
$address->setValidFrom(\DateTime::createFromImmutable($date));
$address->setValidFrom(\DateTime::createFromImmutable($date));
if (\random_int(0, 20) < 1) {
$date = $date->add(new \DateInterval('P'.\random_int(8, 52).'W'));
@@ -157,6 +157,7 @@ class LoadHousehold extends Fixture implements DependentFixtureInterface
->setParameter('center', 'Center A')
->getScalarResult()
;
\shuffle($this->personIds);
}