diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php index 5a769da89..8288f5c74 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php @@ -89,7 +89,7 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface { $reasonRef = LoadActivityReason::$references[array_rand(LoadActivityReason::$references)]; - return $this->getReference($reasonRef); + return $this->getReference($reasonRef, null); } /** @@ -99,7 +99,7 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface { $typeRef = LoadActivityType::$references[array_rand(LoadActivityType::$references)]; - return $this->getReference($typeRef); + return $this->getReference($typeRef, null); } /** @@ -109,7 +109,7 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface { $scopeRef = LoadScopes::$references[array_rand(LoadScopes::$references)]; - return $this->getReference($scopeRef); + return $this->getReference($scopeRef, null); } /** @@ -119,6 +119,6 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface { $userRef = array_rand(LoadUsers::$refs); - return $this->getReference($userRef); + return $this->getReference($userRef, null); } } diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReason.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReason.php index 5633bffe3..513a786a8 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReason.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReason.php @@ -56,7 +56,7 @@ class LoadActivityReason extends AbstractFixture implements OrderedFixtureInterf $activityReason = (new ActivityReason()) ->setName($r['name']) ->setActive(true) - ->setCategory($this->getReference($r['category'])); + ->setCategory($this->getReference($r['category'], null)); $manager->persist($activityReason); $reference = 'activity_reason_'.$r['name']['en']; $this->addReference($reference, $activityReason); diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityType.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityType.php index 683d28eb4..7af12764e 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityType.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityType.php @@ -57,7 +57,7 @@ class LoadActivityType extends Fixture implements OrderedFixtureInterface echo 'Creating activity type : '.$t['name']['fr'].' (cat:'.$t['category']." \n"; $activityType = (new ActivityType()) ->setName($t['name']) - ->setCategory($this->getReference('activity_type_cat_'.$t['category'])) + ->setCategory($this->getReference('activity_type_cat_'.$t['category'], null)) ->setSocialIssuesVisible(1) ->setSocialActionsVisible(1); $manager->persist($activityType); diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivitytACL.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivitytACL.php index 96e124b18..0dbeb4aaf 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivitytACL.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivitytACL.php @@ -34,10 +34,10 @@ class LoadActivitytACL extends AbstractFixture implements OrderedFixtureInterfac 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': diff --git a/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivity.php index 75cac30a1..e3b6359fe 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivity.php @@ -43,7 +43,7 @@ class LoadAsideActivity extends Fixture implements DependentFixtureInterface ->setUpdatedAt(new \DateTimeImmutable('now')) ->setUpdatedBy($user) ->setType( - $this->getReference('aside_activity_category_0') + $this->getReference('aside_activity_category_0', null) ) ->setDate((new \DateTimeImmutable('today')) ->sub(new \DateInterval('P'.\random_int(1, 100).'D'))); diff --git a/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarACL.php b/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarACL.php index 2ef7365ca..66430208b 100644 --- a/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarACL.php +++ b/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarACL.php @@ -37,7 +37,7 @@ class LoadCalendarACL extends Fixture implements OrderedFixtureInterface foreach (LoadPermissionsGroup::$refs as $permissionGroupRef) { /** @var PermissionsGroup $group */ - $group = $this->getReference($permissionGroupRef); + $group = $this->getReference($permissionGroupRef, null); foreach ($roleScopes as $scope) { $group->addRoleScope($scope); diff --git a/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadInvite.php b/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadInvite.php index f677a4283..e869737c6 100644 --- a/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadInvite.php +++ b/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadInvite.php @@ -63,6 +63,6 @@ class LoadInvite extends Fixture implements FixtureGroupInterface { $userRef = array_rand(LoadUsers::$refs); - return $this->getReference($userRef); + return $this->getReference($userRef, null); } } diff --git a/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentACL.php b/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentACL.php index 4b4377462..cbb8c60e8 100644 --- a/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentACL.php +++ b/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentACL.php @@ -32,11 +32,11 @@ class LoadDocumentACL extends AbstractFixture implements OrderedFixtureInterface public function load(ObjectManager $manager): void { foreach (LoadPermissionsGroup::$refs as $permissionsGroupRef) { - $permissionsGroup = $this->getReference($permissionsGroupRef); + $permissionsGroup = $this->getReference($permissionsGroupRef, null); printf("processing permission group %s \n", $permissionsGroup->getName()); foreach (LoadScopes::$references as $scopeRef) { - $scope = $this->getReference($scopeRef); + $scope = $this->getReference($scopeRef, null); printf("processing scope %s \n", $scope->getName()['en']); // create permission group switch ($permissionsGroup->getName()) { diff --git a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php index 2649fe78e..fbd3b5443 100644 --- a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php +++ b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php @@ -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); diff --git a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadRolesACL.php b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadRolesACL.php index 23ee1ee06..52dbecee8 100644 --- a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadRolesACL.php +++ b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadRolesACL.php @@ -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': diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAbstractNotificationsTrait.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAbstractNotificationsTrait.php index 0e9eb3f84..096c52d2a 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAbstractNotificationsTrait.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAbstractNotificationsTrait.php @@ -24,20 +24,20 @@ trait LoadAbstractNotificationsTrait return; foreach ($this->notifs as $notif) { - $entityId = $this->getReference($notif['entityRef'])->getId(); + $entityId = $this->getReference($notif['entityRef'], null)->getId(); echo 'Adding notification for '.$notif['entityClass'].'(entity id:'.$entityId.")\n"; $newNotif = (new Notification()) ->setMessage($notif['message']) - ->setSender($this->getReference($notif['sender'])) + ->setSender($this->getReference($notif['sender'], null)) ->setRelatedEntityClass($notif['entityClass']) ->setRelatedEntityId($entityId) ->setDate(new \DateTimeImmutable('now')) ->setRead([]); foreach ($notif['addressees'] as $addressee) { - $newNotif->addAddressee($this->getReference($addressee)); + $newNotif->addAddressee($this->getReference($addressee, null)); } $manager->persist($newNotif); diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAddressReferences.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAddressReferences.php index 7b79c0b75..2d09412f9 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAddressReferences.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAddressReferences.php @@ -69,7 +69,8 @@ class LoadAddressReferences extends AbstractFixture implements ContainerAwareInt $ar->setStreetNumber((string) random_int(0, 199)); $ar->setPoint($this->getRandomPoint()); $ar->setPostcode($this->getReference( - LoadPostalCodes::$refs[array_rand(LoadPostalCodes::$refs)] + LoadPostalCodes::$refs[array_rand(LoadPostalCodes::$refs)], + null )); $ar->setMunicipalityCode($ar->getPostcode()->getCode()); diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadGroupCenters.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadGroupCenters.php index 45170fa24..b4fbb7bb8 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadGroupCenters.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadGroupCenters.php @@ -30,8 +30,8 @@ class LoadGroupCenters extends AbstractFixture implements OrderedFixtureInterfac foreach (LoadCenters::$refs as $centerRef) { foreach (LoadPermissionsGroup::$refs as $permissionGroupRef) { $GroupCenter = new GroupCenter(); - $GroupCenter->setCenter($this->getReference($centerRef)); - $GroupCenter->setPermissionsGroup($this->getReference($permissionGroupRef)); + $GroupCenter->setCenter($this->getReference($centerRef, null)); + $GroupCenter->setPermissionsGroup($this->getReference($permissionGroupRef, null)); $manager->persist($GroupCenter); diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPermissionsGroup.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPermissionsGroup.php index 07f41a515..2ef682259 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPermissionsGroup.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPermissionsGroup.php @@ -59,7 +59,7 @@ class LoadPermissionsGroup extends AbstractFixture implements OrderedFixtureInte $permissionGroup->setName($new['name']); foreach ($new['role_scopes'] as $roleScopeRef) { - $permissionGroup->addRoleScope($this->getReference($roleScopeRef)); + $permissionGroup->addRoleScope($this->getReference($roleScopeRef, null)); } $manager->persist($permissionGroup); diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPostalCodes.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPostalCodes.php index 0e9ecbde5..68f220d74 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPostalCodes.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPostalCodes.php @@ -365,7 +365,7 @@ class LoadPostalCodes extends AbstractFixture implements OrderedFixtureInterface $manager->persist($c); $ref = 'postal_code_'.$code[0]; - if (!$this->hasReference($ref)) { + if (!$this->hasReference($ref, null)) { $this->addReference($ref, $c); self::$refs[] = $ref; } diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadRoleScopes.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadRoleScopes.php index ad431c148..aff69c695 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadRoleScopes.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadRoleScopes.php @@ -55,8 +55,8 @@ class LoadRoleScopes extends AbstractFixture implements OrderedFixtureInterface foreach (LoadScopes::$references as $scopeReference) { $roleScope = new RoleScope(); $roleScope->setRole($key) - ->setScope($this->getReference($scopeReference)); - $reference = 'role_scope_'.$key.'_'.$this->getReference($scopeReference)->getName()['en']; + ->setScope($this->getReference($scopeReference, null)); + $reference = 'role_scope_'.$key.'_'.$this->getReference($scopeReference, null)->getName()['en']; echo "Creating {$reference} \n"; $this->addReference($reference, $roleScope); $manager->persist($roleScope); diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php index 166a27c9e..aa25593b3 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php @@ -80,7 +80,7 @@ class LoadUsers extends AbstractFixture implements ContainerAwareInterface, Orde ->setEmail(sprintf('%s@chill.social', \str_replace(' ', '', (string) $username))); foreach ($params['groupCenterRefs'] as $groupCenterRef) { - $user->addGroupCenter($this->getReference($groupCenterRef)); + $user->addGroupCenter($this->getReference($groupCenterRef, null)); } echo 'Creating user '.$username."... \n"; diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php index e24cca688..1f2282082 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php @@ -64,9 +64,9 @@ class LoadAccompanyingPeriodWork extends \Doctrine\Bundle\FixturesBundle\Fixture ->setStartDate(new \DateTimeImmutable('today')) ->addPerson($period->getPersons()->first()) ->setCreatedAt(new \DateTimeImmutable()) - ->setCreatedBy($this->getReference('center a_social')) + ->setCreatedBy($this->getReference('center a_social', null)) ->setUpdatedAt(new \DateTimeImmutable()) - ->setUpdatedBy($this->getReference('center a_social')); + ->setUpdatedBy($this->getReference('center a_social', null)); $manager->persist($work); if ($action->getEvaluations()->count() > 0) { @@ -91,9 +91,9 @@ class LoadAccompanyingPeriodWork extends \Doctrine\Bundle\FixturesBundle\Fixture ->setStartDate(new \DateTimeImmutable('today')) ->addPerson($period->getPersons()->first()) ->setCreatedAt(new \DateTimeImmutable()) - ->setCreatedBy($this->getReference('center a_social')) + ->setCreatedBy($this->getReference('center a_social', null)) ->setUpdatedAt(new \DateTimeImmutable()) - ->setUpdatedBy($this->getReference('center a_social')); + ->setUpdatedBy($this->getReference('center a_social', null)); $manager->persist($work); $ev = new AccompanyingPeriod\AccompanyingPeriodWorkEvaluation(); $ev->setAccompanyingPeriodWork($work) diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php index cf9a2b1e0..a3543870f 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php @@ -127,7 +127,7 @@ class LoadHousehold extends Fixture implements DependentFixtureInterface foreach ($this->getRandomPersons(1, 3) as $person) { $date = $startDate->add(new \DateInterval('P'.\random_int(1, 200).'W')); - $position = $this->getReference(LoadHouseholdPosition::ADULT); + $position = $this->getReference(LoadHouseholdPosition::ADULT, null); $movement->addMovement($date, $person, $position, 0 === $k, 'self generated'); ++$k; @@ -136,7 +136,7 @@ class LoadHousehold extends Fixture implements DependentFixtureInterface // load children foreach ($this->getRandomPersons(0, 3) as $person) { $date = $startDate->add(new \DateInterval('P'.\random_int(1, 200).'W')); - $position = $this->getReference(LoadHouseholdPosition::CHILD); + $position = $this->getReference(LoadHouseholdPosition::CHILD, null); $movement->addMovement($date, $person, $position, 0 === $k, 'self generated'); ++$k; @@ -145,7 +145,7 @@ class LoadHousehold extends Fixture implements DependentFixtureInterface // load children out foreach ($this->getRandomPersons(0, 2) as $person) { $date = $startDate->add(new \DateInterval('P'.\random_int(1, 200).'W')); - $position = $this->getReference(LoadHouseholdPosition::CHILD_OUT); + $position = $this->getReference(LoadHouseholdPosition::CHILD_OUT, null); $movement->addMovement($date, $person, $position, 0 === $k, 'self generated'); ++$k; @@ -161,7 +161,7 @@ class LoadHousehold extends Fixture implements DependentFixtureInterface { $ref = LoadPostalCodes::$refs[\array_rand(LoadPostalCodes::$refs)]; - return $this->getReference($ref); + return $this->getReference($ref, null); } private function getRandomPersons(int $min, int $max): array diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php index 4f2ca1e5c..9a1d2bc54 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php @@ -358,8 +358,8 @@ class LoadPeople extends AbstractFixture implements ContainerAwareInterface, Ord if (\random_int(0, 10) > 3) { // always add social scope: - $accompanyingPeriod->addScope($this->getReference('scope_social')); - $origin = $this->getReference(LoadAccompanyingPeriodOrigin::ACCOMPANYING_PERIOD_ORIGIN); + $accompanyingPeriod->addScope($this->getReference('scope_social', null)); + $origin = $this->getReference(LoadAccompanyingPeriodOrigin::ACCOMPANYING_PERIOD_ORIGIN, null); $accompanyingPeriod->setOrigin($origin); $accompanyingPeriod->setIntensity('regular'); $accompanyingPeriod->setAddressLocation($this->createAddress()); @@ -472,7 +472,7 @@ class LoadPeople extends AbstractFixture implements ContainerAwareInterface, Ord { $ref = LoadPostalCodes::$refs[array_rand(LoadPostalCodes::$refs)]; - return $this->getReference($ref); + return $this->getReference($ref, null); } private function getRandomSocialIssue(): SocialIssue diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPersonACL.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPersonACL.php index ec17b6f0a..7b46d7c06 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPersonACL.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPersonACL.php @@ -33,8 +33,8 @@ class LoadPersonACL extends AbstractFixture implements OrderedFixtureInterface public function load(ObjectManager $manager): void { foreach (LoadPermissionsGroup::$refs as $permissionsGroupRef) { - $permissionsGroup = $this->getReference($permissionsGroupRef); - $scopeSocial = $this->getReference('scope_social'); + $permissionsGroup = $this->getReference($permissionsGroupRef, null); + $scopeSocial = $this->getReference('scope_social', null); // create permission group switch ($permissionsGroup->getName()) { diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelationships.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelationships.php index 3efcc6386..eeb42164a 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelationships.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelationships.php @@ -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); } } diff --git a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomField.php b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomField.php index d4b984e11..f8493f4c8 100644 --- a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomField.php +++ b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomField.php @@ -74,7 +74,7 @@ class LoadCustomField extends AbstractFixture implements OrderedFixtureInterface ->setOptions($cFType['options']) ->setName(['fr' => "CustomField {$i}"]) ->setOrdering(random_int(0, 1000) / 1000) - ->setCustomFieldsGroup($this->getReference('cf_group_report_'.random_int(0, 3))); + ->setCustomFieldsGroup($this->getReference('cf_group_report_'.random_int(0, 3), null)); $manager->persist($customField); } @@ -87,7 +87,7 @@ class LoadCustomField extends AbstractFixture implements OrderedFixtureInterface private function createExpectedFields(ObjectManager $manager) { // report logement - $reportLogement = $this->getReference('cf_group_report_logement'); + $reportLogement = $this->getReference('cf_group_report_logement', null); $houseTitle = (new CustomField()) ->setSlug('house_title') @@ -143,7 +143,7 @@ class LoadCustomField extends AbstractFixture implements OrderedFixtureInterface $manager->persist($descriptionLogement); // report problems - $reportEducation = $this->getReference('cf_group_report_education'); + $reportEducation = $this->getReference('cf_group_report_education', null); $title = (new CustomField()) ->setSlug('title') diff --git a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReportACL.php b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReportACL.php index dd79fe3f3..6776ece5d 100644 --- a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReportACL.php +++ b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReportACL.php @@ -32,11 +32,11 @@ class LoadReportACL extends AbstractFixture implements OrderedFixtureInterface public function load(ObjectManager $manager): void { foreach (LoadPermissionsGroup::$refs as $permissionsGroupRef) { - $permissionsGroup = $this->getReference($permissionsGroupRef); + $permissionsGroup = $this->getReference($permissionsGroupRef, null); printf("processing permission group %s \n", $permissionsGroup->getName()); foreach (LoadScopes::$references as $scopeRef) { - $scope = $this->getReference($scopeRef); + $scope = $this->getReference($scopeRef, null); printf("processing scope %s \n", $scope->getName()['en']); // create permission group switch ($permissionsGroup->getName()) { diff --git a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php index f757ea2fa..287705661 100644 --- a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php +++ b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php @@ -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); } /** diff --git a/src/Bundle/ChillTaskBundle/DataFixtures/ORM/LoadTaskACL.php b/src/Bundle/ChillTaskBundle/DataFixtures/ORM/LoadTaskACL.php index 9d3385e1e..14b72ed54 100644 --- a/src/Bundle/ChillTaskBundle/DataFixtures/ORM/LoadTaskACL.php +++ b/src/Bundle/ChillTaskBundle/DataFixtures/ORM/LoadTaskACL.php @@ -33,10 +33,10 @@ class LoadTaskACL 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': diff --git a/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php b/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php index 8eb5dd48c..74713015c 100644 --- a/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php +++ b/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php @@ -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