eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler\RegisterSearchEngineIndexerPass::process PHP Method

process() public method

Register all found search engine indexers to the SearchEngineIndexerFactory.
public process ( ContainerBuilder $container )
$container Symfony\Component\DependencyInjection\ContainerBuilder
    public function process(ContainerBuilder $container)
    {
        if (!$container->hasDefinition($this->factoryId)) {
            return;
        }
        $searchEngineIndexerFactoryDefinition = $container->getDefinition($this->factoryId);
        foreach ($container->findTaggedServiceIds('ezpublish.searchEngineIndexer') as $id => $attributes) {
            foreach ($attributes as $attribute) {
                if (!isset($attribute['alias'])) {
                    throw new LogicException('ezpublish.searchEngineIndexer service tag needs an "alias" attribute to ' . 'identify the search engine. None given.');
                }
                // Register the search engine with the search engine factory
                $searchEngineIndexerFactoryDefinition->addMethodCall('registerSearchEngineIndexer', [new Reference($id), $attribute['alias']]);
            }
        }
    }
RegisterSearchEngineIndexerPass