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

RegisterSearchEngineIndexerPass.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler;
8
9 use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
10 use Symfony\Component\DependencyInjection\ContainerBuilder;
11 use Symfony\Component\DependencyInjection\Reference;
12 use LogicException;
13
17 class RegisterSearchEngineIndexerPass implements CompilerPassInterface
18 {
26 protected $factoryId = 'ezpublish.api.search_engine.indexer.factory';
27
35 public function process(ContainerBuilder $container)
36 {
37 if (!$container->hasDefinition($this->factoryId)) {
38 return;
39 }
40
41 $searchEngineIndexerFactoryDefinition = $container->getDefinition($this->factoryId);
42 foreach ($container->findTaggedServiceIds('ezpublish.searchEngineIndexer') as $id => $attributes) {
43 foreach ($attributes as $attribute) {
44 if (!isset($attribute['alias'])) {
45 throw new LogicException(
46 'ezpublish.searchEngineIndexer service tag needs an "alias" attribute to ' .
47 'identify the search engine. None given.'
48 );
49 }
50
51 // Register the search engine with the search engine factory
52 $searchEngineIndexerFactoryDefinition->addMethodCall(
53 'registerSearchEngineIndexer',
54 [
55 new Reference($id),
56 $attribute['alias'],
57 ]
58 );
59 }
60 }
61 }
62 }
eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler\RegisterSearchEngineIndexerPass
This compiler pass registers eZ Publish search engines indexers.
Definition: RegisterSearchEngineIndexerPass.php:18
eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler\RegisterSearchEngineIndexerPass\$factoryId
$factoryId
Definition: RegisterSearchEngineIndexerPass.php:26
eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler\RegisterSearchEngineIndexerPass\process
process(ContainerBuilder $container)
Register all found search engine indexers to the SearchEngineIndexerFactory.
Definition: RegisterSearchEngineIndexerPass.php:35
eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler
Definition: AsseticPass.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.