eZ\Publish\Core\Base\Container\Compiler\Search\FieldRegistryPass::process PHP Method

process() public method

public process ( ContainerBuilder $container )
$container Symfony\Component\DependencyInjection\ContainerBuilder
    public function process(ContainerBuilder $container)
    {
        if (!$container->hasDefinition('ezpublish.search.common.field_registry')) {
            return;
        }
        $fieldRegistryDefinition = $container->getDefinition('ezpublish.search.common.field_registry');
        foreach ($container->findTaggedServiceIds('ezpublish.fieldType.indexable') as $id => $attributes) {
            foreach ($attributes as $attribute) {
                if (!isset($attribute['alias'])) {
                    throw new LogicException('ezpublish.fieldType.indexable service tag needs an "alias" attribute to ' . 'identify the indexable field type. None given.');
                }
                $fieldRegistryDefinition->addMethodCall('registerType', array($attribute['alias'], new Reference($id)));
            }
        }
    }
FieldRegistryPass