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

@@ -46,7 +46,7 @@ class LoadRelationships extends Fixture implements DependentFixtureInterface
->setFromPerson($this->getRandomPerson($this->em))
->setToPerson($this->getRandomPerson($this->em))
->setRelation($this->getReference(LoadRelations::RELATION_KEY.
random_int(0, \count(LoadRelations::RELATIONS) - 1)))
random_int(0, \count(LoadRelations::RELATIONS) - 1), null))
->setReverse((bool) random_int(0, 1))
->setCreatedBy($user)
->setUpdatedBy($user)
@@ -74,6 +74,6 @@ class LoadRelationships extends Fixture implements DependentFixtureInterface
{
$userRef = array_rand(LoadUsers::$refs);
return $this->getReference($userRef);
return $this->getReference($userRef, null);
}
}