mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-29 19:13:49 +00:00
Add second parameter to add-, get-, hasReference() methods in fixture classes
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user