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

Publish/Core/Base/Container/Compiler/Search/SignalSlotPass.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\Base\Container\Compiler\Search;
8
9 use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
10 use Symfony\Component\DependencyInjection\ContainerBuilder;
11 use LogicException;
12 use Symfony\Component\DependencyInjection\Reference;
13
19 class SignalSlotPass implements CompilerPassInterface
20 {
21 public function process(ContainerBuilder $container)
22 {
23 if (!$container->hasDefinition('ezpublish.signalslot.signal_dispatcher')) {
24 return;
25 }
26
27 $signalDispatcherDef = $container->getDefinition('ezpublish.signalslot.signal_dispatcher');
28
29 foreach ($container->findTaggedServiceIds('ezpublish.search.slot') as $id => $attributes) {
30 foreach ($attributes as $attribute) {
31 if (!isset($attribute['signal'])) {
32 throw new LogicException(
33 "Could not find 'signal' attribute on '$id' service, " .
34 "which is mandatory for services tagged as 'ezpublish.persistence.solr.slot'"
35 );
36 }
37
38 $signalDispatcherDef->addMethodCall(
39 'attach',
40 [
41 $attribute['signal'],
42 new Reference($id),
43 ]
44 );
45 }
46 }
47 }
48 }
eZ\Publish\Core\Base\Container\Compiler\Search\SignalSlotPass
This compiler pass will attach Search Engine slots to SignalDispatcher.
Definition: Publish/Core/Base/Container/Compiler/Search/SignalSlotPass.php:20
eZ\Publish\Core\Base\Container\Compiler\Search\SignalSlotPass\process
process(ContainerBuilder $container)
Definition: Publish/Core/Base/Container/Compiler/Search/SignalSlotPass.php:21
eZ\Publish\Core\Base\Container\Compiler\Search
Definition: AggregateFieldValueMapperPass.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.