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

@@ -60,9 +60,9 @@ final class LoadReports extends AbstractFixture implements OrderedFixtureInterfa
if (null !== $charline) {
$report = (new Report())
->setPerson($charline)
->setCFGroup($this->getReference('cf_group_report_logement'))
->setCFGroup($this->getReference('cf_group_report_logement', null))
->setDate(new \DateTime('2015-01-05'))
->setScope($this->getReference('scope_social'));
->setScope($this->getReference('scope_social', null));
$this->fillReport($report);
$manager->persist($report);
@@ -81,8 +81,8 @@ final class LoadReports extends AbstractFixture implements OrderedFixtureInterfa
->setPerson($person)
->setCFGroup(
random_int(0, 10) > 5 ?
$this->getReference('cf_group_report_logement') :
$this->getReference('cf_group_report_education')
$this->getReference('cf_group_report_logement', null) :
$this->getReference('cf_group_report_education', null)
)
->setScope($this->getScopeRandom());
$this->fillReport($report);
@@ -95,7 +95,7 @@ final class LoadReports extends AbstractFixture implements OrderedFixtureInterfa
// setUser
$usernameRef = array_rand(LoadUsers::$refs);
$report->setUser(
$this->getReference($usernameRef)
$this->getReference($usernameRef, null)
);
// set date if null
@@ -214,7 +214,7 @@ final class LoadReports extends AbstractFixture implements OrderedFixtureInterfa
{
$ref = LoadScopes::$references[array_rand(LoadScopes::$references)];
return $this->getReference($ref);
return $this->getReference($ref, null);
}
/**