From 11ad166701151fd6e2925f864595c5bfb3d2a7f1 Mon Sep 17 00:00:00 2001 From: Oleksandr Zhyian Date: Tue, 2 Jul 2024 17:49:43 +0300 Subject: [PATCH] feat: add WpQuerySplitter to split massive HIS code relationship queries into smaller ones --- src/Infrastructure/Repository/RepositoryModule.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Infrastructure/Repository/RepositoryModule.php b/src/Infrastructure/Repository/RepositoryModule.php index 6d5b5b3..a5b3263 100644 --- a/src/Infrastructure/Repository/RepositoryModule.php +++ b/src/Infrastructure/Repository/RepositoryModule.php @@ -19,6 +19,7 @@ use Fau\DegreeProgram\Common\Infrastructure\Repository\WordPressDatabaseDegreeProgramRepository; use Fau\DegreeProgram\Common\Infrastructure\Repository\WordPressDatabaseDegreeProgramViewRepository; use Fau\DegreeProgram\Common\Infrastructure\Repository\WpQueryArgsBuilder; +use Fau\DegreeProgram\Common\Infrastructure\Repository\WpQuerySplitter; use Fau\DegreeProgram\Common\Infrastructure\Sanitizer\HtmlDegreeProgramSanitizer; use Fau\DegreeProgram\Output\Application\OriginalDegreeProgramViewRepository; use Fau\DegreeProgram\Output\Infrastructure\ApiClient\ApiClient; @@ -60,6 +61,10 @@ public function services(): array WordPressDatabaseDegreeProgramCollectionRepository::class => static fn(ContainerInterface $container) => new WordPressDatabaseDegreeProgramCollectionRepository( $container->get(DegreeProgramViewRepository::class), $container->get(WpQueryArgsBuilder::class), + $container->get(WpQuerySplitter::class) + ), + WpQuerySplitter::class => static fn(ContainerInterface $container) => new WpQuerySplitter( + $container->get(WpQueryArgsBuilder::class) ), DegreeProgramCollectionRepository::class => static fn(ContainerInterface $container) => new CachedApiCollectionRepository( $container->get(WordPressDatabaseDegreeProgramCollectionRepository::class),