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

@@ -44,11 +44,12 @@ class LoadParticipation extends AbstractFixture implements OrderedFixtureInterfa
$event = (new Event())
->setDate($this->faker->dateTimeBetween('-2 years', '+6 months'))
->setName($this->faker->words(random_int(2, 4), true))
->setType($this->getReference(LoadEventTypes::$refs[array_rand(LoadEventTypes::$refs)]))
->setType($this->getReference(LoadEventTypes::$refs[array_rand(LoadEventTypes::$refs)], null))
->setCenter($center)
->setCircle(
$this->getReference(
LoadScopes::$references[array_rand(LoadScopes::$references)]
LoadScopes::$references[array_rand(LoadScopes::$references)],
null
)
);
$manager->persist($event);

View File

@@ -31,10 +31,10 @@ class LoadRolesACL extends AbstractFixture implements OrderedFixtureInterface
public function load(ObjectManager $manager): void
{
foreach (LoadPermissionsGroup::$refs as $permissionsGroupRef) {
$permissionsGroup = $this->getReference($permissionsGroupRef);
$permissionsGroup = $this->getReference($permissionsGroupRef, null);
foreach (LoadScopes::$references as $scopeRef) {
$scope = $this->getReference($scopeRef);
$scope = $this->getReference($scopeRef, null);
// create permission group
switch ($permissionsGroup->getName()) {
case 'social':