Skip to content

Commit

Permalink
Add registry for repositories
Browse files Browse the repository at this point in the history
  • Loading branch information
digedag committed Oct 5, 2024
1 parent de32807 commit d25df61
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Classes/Domain/Repository/RepositoryRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Sys25\RnBase\Domain\Repository;

use tx_rnbase;

/***************************************************************
* Copyright notice
*
Expand Down Expand Up @@ -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;
}
}
2 changes: 1 addition & 1 deletion Configuration/Services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ services:
Sys25\RnBase\Backend\Module\ModFuncFrame:
public: true

Sys25\\RnBase\\Domain\\Repository\\RepositoryRegistry:
Sys25\RnBase\Domain\Repository\RepositoryRegistry:
public: true

0 comments on commit d25df61

Please sign in to comment.