Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

SortClauseConverterPass.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\Base\Container\Compiler\Search\Legacy;
8
9 use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
10 use Symfony\Component\DependencyInjection\ContainerBuilder;
11 use Symfony\Component\DependencyInjection\Reference;
12 use Symfony\Component\DependencyInjection\Definition;
13
17 class SortClauseConverterPass implements CompilerPassInterface
18 {
22 public function process(ContainerBuilder $container)
23 {
24 if (
25 !$container->hasDefinition('ezpublish.search.legacy.gateway.sort_clause_converter.content') &&
26 !$container->hasDefinition('ezpublish.search.legacy.gateway.sort_clause_converter.location')
27 ) {
28 return;
29 }
30
31 if ($container->hasDefinition('ezpublish.search.legacy.gateway.sort_clause_converter.content')) {
32 $sortClauseConverterContent = $container->getDefinition('ezpublish.search.legacy.gateway.sort_clause_converter.content');
33
34 $contentHandlers = $container->findTaggedServiceIds('ezpublish.search.legacy.gateway.sort_clause_handler.content');
35
36 $this->addHandlers($sortClauseConverterContent, $contentHandlers);
37 }
38
39 if ($container->hasDefinition('ezpublish.search.legacy.gateway.sort_clause_converter.location')) {
40 $sortClauseConverterLocation = $container->getDefinition('ezpublish.search.legacy.gateway.sort_clause_converter.location');
41
42 $locationHandlers = $container->findTaggedServiceIds('ezpublish.search.legacy.gateway.sort_clause_handler.location');
43
44 $this->addHandlers($sortClauseConverterLocation, $locationHandlers);
45 }
46 }
47
48 protected function addHandlers(Definition $definition, $handlers)
49 {
50 foreach ($handlers as $id => $attributes) {
51 $definition->addMethodCall('addHandler', [new Reference($id)]);
52 }
53 }
54 }
eZ\Publish\Core\Base\Container\Compiler\Search\Legacy\SortClauseConverterPass
This compiler pass will register Legacy Storage sort clause handlers.
Definition: SortClauseConverterPass.php:18
eZ\Publish\Core\Base\Container\Compiler\Search\Legacy\SortClauseConverterPass\addHandlers
addHandlers(Definition $definition, $handlers)
Definition: SortClauseConverterPass.php:48
eZ\Publish\Core\Base\Container\Compiler\Search\Legacy\SortClauseConverterPass\process
process(ContainerBuilder $container)
Definition: SortClauseConverterPass.php:22
eZ\Publish\Core\Base\Container\Compiler\Search\Legacy
Definition: CriteriaConverterPass.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.