mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2026-04-25 23:39:32 +00:00
Add second parameter to add-, get-, hasReference() methods in fixture classes
This commit is contained in:
@@ -127,7 +127,7 @@ class LoadHousehold extends Fixture implements DependentFixtureInterface
|
||||
|
||||
foreach ($this->getRandomPersons(1, 3) as $person) {
|
||||
$date = $startDate->add(new \DateInterval('P'.\random_int(1, 200).'W'));
|
||||
$position = $this->getReference(LoadHouseholdPosition::ADULT);
|
||||
$position = $this->getReference(LoadHouseholdPosition::ADULT, null);
|
||||
|
||||
$movement->addMovement($date, $person, $position, 0 === $k, 'self generated');
|
||||
++$k;
|
||||
@@ -136,7 +136,7 @@ class LoadHousehold extends Fixture implements DependentFixtureInterface
|
||||
// load children
|
||||
foreach ($this->getRandomPersons(0, 3) as $person) {
|
||||
$date = $startDate->add(new \DateInterval('P'.\random_int(1, 200).'W'));
|
||||
$position = $this->getReference(LoadHouseholdPosition::CHILD);
|
||||
$position = $this->getReference(LoadHouseholdPosition::CHILD, null);
|
||||
|
||||
$movement->addMovement($date, $person, $position, 0 === $k, 'self generated');
|
||||
++$k;
|
||||
@@ -145,7 +145,7 @@ class LoadHousehold extends Fixture implements DependentFixtureInterface
|
||||
// load children out
|
||||
foreach ($this->getRandomPersons(0, 2) as $person) {
|
||||
$date = $startDate->add(new \DateInterval('P'.\random_int(1, 200).'W'));
|
||||
$position = $this->getReference(LoadHouseholdPosition::CHILD_OUT);
|
||||
$position = $this->getReference(LoadHouseholdPosition::CHILD_OUT, null);
|
||||
|
||||
$movement->addMovement($date, $person, $position, 0 === $k, 'self generated');
|
||||
++$k;
|
||||
@@ -161,7 +161,7 @@ class LoadHousehold extends Fixture implements DependentFixtureInterface
|
||||
{
|
||||
$ref = LoadPostalCodes::$refs[\array_rand(LoadPostalCodes::$refs)];
|
||||
|
||||
return $this->getReference($ref);
|
||||
return $this->getReference($ref, null);
|
||||
}
|
||||
|
||||
private function getRandomPersons(int $min, int $max): array
|
||||
|
||||
Reference in New Issue
Block a user