Add second parameter to add-, get-, hasReference() methods in fixture classes

This commit is contained in:
2024-11-28 12:44:14 +01:00
parent 0ac49d1fde
commit 19e6ceba28
27 changed files with 61 additions and 59 deletions

View File

@@ -70,10 +70,10 @@ class LoadThirdParty extends Fixture implements DependentFixtureInterface
$number = random_int(1, \count($references));
if (1 === $number) {
yield $this->getReference($references[array_rand($references)]);
yield $this->getReference($references[array_rand($references)], null);
} else {
foreach (array_rand($references, $number) as $index) {
yield $this->getReference($references[$index]);
yield $this->getReference($references[$index], null);
}
}
}
@@ -82,7 +82,7 @@ class LoadThirdParty extends Fixture implements DependentFixtureInterface
{
$ref = LoadPostalCodes::$refs[array_rand(LoadPostalCodes::$refs)];
return $this->getReference($ref);
return $this->getReference($ref, null);
}
private function getThirdParties(): ObjectSet