diff --git a/Classes/Domain/Repository/RepositoryRegistry.php b/Classes/Domain/Repository/RepositoryRegistry.php index 076658e8..a00ff853 100644 --- a/Classes/Domain/Repository/RepositoryRegistry.php +++ b/Classes/Domain/Repository/RepositoryRegistry.php @@ -2,6 +2,8 @@ namespace Sys25\RnBase\Domain\Repository; +use tx_rnbase; + /*************************************************************** * Copyright notice * @@ -41,6 +43,8 @@ public function addRepository(AbstractRepository $repository): void public static function getRepositoryForClass(string $modelClass): ?AbstractRepository { - return self::$repos[$modelClass] ?? null; + $instance = tx_rnbase::makeInstance(self::class); + + return $instance::$repos[$modelClass] ?? null; } } diff --git a/Configuration/Services.yaml b/Configuration/Services.yaml index 6c287e12..70f969ca 100644 --- a/Configuration/Services.yaml +++ b/Configuration/Services.yaml @@ -17,5 +17,5 @@ services: Sys25\RnBase\Backend\Module\ModFuncFrame: public: true - Sys25\\RnBase\\Domain\\Repository\\RepositoryRegistry: + Sys25\RnBase\Domain\Repository\RepositoryRegistry: public: true