-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NGSTACK-819: reconfigure services to use FilterService search adapter…
… from Netgen Site API
- Loading branch information
Showing
3 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
bundle/DependencyInjection/Compiler/SearchOverridePass.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Netgen\Bundle\BetterIbexaAdminUIBundle\DependencyInjection\Compiler; | ||
|
||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Ibexa\AdminUi\Tab\Dashboard\MyContentTab; | ||
use Ibexa\AdminUi\Tab\Dashboard\EveryoneContentTab; | ||
use Ibexa\AdminUi\Tab\Dashboard\MyMediaTab; | ||
use Ibexa\AdminUi\Tab\Dashboard\EveryoneMediaTab; | ||
use Ibexa\AdminUi\Tab\LocationView\LocationsTab; | ||
use Ibexa\AdminUi\UI\Service\PathService; | ||
use Ibexa\GraphQL\DataLoader\SearchContentLoader; | ||
use Ibexa\GraphQL\DataLoader\SearchLocationLoader; | ||
use Ibexa\AdminUi\UI\Module\ContentTree\NodeFactory; | ||
use Ibexa\Bundle\AdminUi\Controller\SectionController; | ||
use Ibexa\AdminUi\UniversalDiscovery\UniversalDiscoveryProvider; | ||
use Symfony\Component\DependencyInjection\Reference; | ||
|
||
final class SearchOverridePass implements CompilerPassInterface | ||
{ | ||
public function process(ContainerBuilder $container): void | ||
{ | ||
if (!$container->hasDefinition('netgen.ibexa_site_api.filter_service.search_adapter')) { | ||
return; | ||
} | ||
|
||
$serviceIds = [ | ||
PathService::class, | ||
MyContentTab::class, | ||
EveryoneContentTab::class, | ||
MyMediaTab::class, | ||
EveryoneMediaTab::class, | ||
LocationsTab::class, | ||
SearchContentLoader::class, | ||
SearchLocationLoader::class, | ||
NodeFactory::class, | ||
SectionController::class, | ||
UniversalDiscoveryProvider::class, | ||
]; | ||
|
||
foreach ($serviceIds as $serviceId) { | ||
$container->findDefinition($serviceId)->setArgument( | ||
'$searchService', | ||
new Reference('netgen.ibexa_site_api.filter_service.search_adapter'), | ||
); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters