From 06e6bb01c9dfc28a2e9c18eee8bc5a41217e6f1a Mon Sep 17 00:00:00 2001 From: Martijn van Beek Date: Wed, 3 Jul 2019 13:46:31 +0200 Subject: [PATCH] [FixtureBundle] Inject the User Entity class name so the correct Repository can be used (#2500) * Bump composer branch alias for 5.4.0 development * Inject the User Entity class name so the correct Repository can be used * Replaced newly introduced parameter with existing '%fos_user.model.user.class%' * fix composer * fix styleci --- src/Kunstmaan/FixturesBundle/Builder/PageBuilder.php | 5 +++-- src/Kunstmaan/FixturesBundle/Resources/config/services.yml | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Kunstmaan/FixturesBundle/Builder/PageBuilder.php b/src/Kunstmaan/FixturesBundle/Builder/PageBuilder.php index fb7af7386b..fb24a20aa4 100644 --- a/src/Kunstmaan/FixturesBundle/Builder/PageBuilder.php +++ b/src/Kunstmaan/FixturesBundle/Builder/PageBuilder.php @@ -42,12 +42,13 @@ public function __construct( ACLPermissionCreatorService $aclPermissionCreatorService, Populator $populator, Slugifier $slugifier, - PagesConfiguration $pagesConfiguration + PagesConfiguration $pagesConfiguration, + string $userClass ) { $this->manager = $em; $this->nodeRepo = $em->getRepository('KunstmaanNodeBundle:Node'); $this->nodeTranslationRepo = $em->getRepository('KunstmaanNodeBundle:NodeTranslation'); - $this->userRepo = $em->getRepository('KunstmaanAdminBundle:User'); + $this->userRepo = $em->getRepository($userClass); $this->aclPermissionCreatorService = $aclPermissionCreatorService; $this->populator = $populator; $this->slugifier = $slugifier; diff --git a/src/Kunstmaan/FixturesBundle/Resources/config/services.yml b/src/Kunstmaan/FixturesBundle/Resources/config/services.yml index 5db6ad3f5d..93d63e5a6d 100644 --- a/src/Kunstmaan/FixturesBundle/Resources/config/services.yml +++ b/src/Kunstmaan/FixturesBundle/Resources/config/services.yml @@ -14,6 +14,7 @@ services: - '@kunstmaan_fixtures.populator.populator' - '@kunstmaan_utilities.slugifier' - '@kunstmaan_node.pages_configuration' + - '%fos_user.model.user.class%' tags: - { name: kunstmaan_fixtures.builder, alias: PageBuilder }