| @@ 20-45 (lines=26) @@ | ||
| 17 | /** |
|
| 18 | * This compiler pass will register Elasticsearch Search Engine field value mappers. |
|
| 19 | */ |
|
| 20 | class AggregateFieldValueMapperPass implements CompilerPassInterface |
|
| 21 | { |
|
| 22 | /** |
|
| 23 | * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container |
|
| 24 | */ |
|
| 25 | public function process(ContainerBuilder $container) |
|
| 26 | { |
|
| 27 | if (!$container->hasDefinition('ezpublish.search.common.field_value_mapper.aggregate')) { |
|
| 28 | return; |
|
| 29 | } |
|
| 30 | ||
| 31 | $aggregateFieldValueMapperDefinition = $container->getDefinition( |
|
| 32 | 'ezpublish.search.common.field_value_mapper.aggregate' |
|
| 33 | ); |
|
| 34 | ||
| 35 | $taggedServiceIds = $container->findTaggedServiceIds( |
|
| 36 | 'ezpublish.search.common.field_value_mapper' |
|
| 37 | ); |
|
| 38 | foreach ($taggedServiceIds as $id => $attributes) { |
|
| 39 | $aggregateFieldValueMapperDefinition->addMethodCall( |
|
| 40 | 'addMapper', |
|
| 41 | [new Reference($id)] |
|
| 42 | ); |
|
| 43 | } |
|
| 44 | } |
|
| 45 | } |
|
| 46 | ||
| @@ 20-47 (lines=28) @@ | ||
| 17 | /** |
|
| 18 | * This compiler pass will register Elasticsearch Search Engine facet builder visitors. |
|
| 19 | */ |
|
| 20 | class AggregateFacetBuilderVisitorPass implements CompilerPassInterface |
|
| 21 | { |
|
| 22 | /** |
|
| 23 | * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container |
|
| 24 | */ |
|
| 25 | public function process(ContainerBuilder $container) |
|
| 26 | { |
|
| 27 | if ( |
|
| 28 | !$container->hasDefinition( |
|
| 29 | 'ezpublish.search.elasticsearch.content.facet_builder_visitor.aggregate' |
|
| 30 | ) |
|
| 31 | ) { |
|
| 32 | return; |
|
| 33 | } |
|
| 34 | ||
| 35 | $aggregateFacetBuilderVisitorDefinition = $container->getDefinition( |
|
| 36 | 'ezpublish.search.elasticsearch.content.facet_builder_visitor.aggregate' |
|
| 37 | ); |
|
| 38 | ||
| 39 | $taggedServiceIds = $container->findTaggedServiceIds('ezpublish.search.elasticsearch.content.facet_builder_visitor'); |
|
| 40 | foreach ($taggedServiceIds as $id => $attributes) { |
|
| 41 | $aggregateFacetBuilderVisitorDefinition->addMethodCall( |
|
| 42 | 'addVisitor', |
|
| 43 | [new Reference($id)] |
|
| 44 | ); |
|
| 45 | } |
|
| 46 | } |
|
| 47 | } |
|
| 48 | ||
| @@ 20-44 (lines=25) @@ | ||
| 17 | /** |
|
| 18 | * This compiler pass will register Legacy Storage role limitation converters. |
|
| 19 | */ |
|
| 20 | class RoleLimitationConverterPass implements CompilerPassInterface |
|
| 21 | { |
|
| 22 | /** |
|
| 23 | * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container |
|
| 24 | * |
|
| 25 | * @throws \LogicException |
|
| 26 | */ |
|
| 27 | public function process(ContainerBuilder $container) |
|
| 28 | { |
|
| 29 | if (!$container->hasDefinition('ezpublish.persistence.legacy.role.limitation.converter')) { |
|
| 30 | return; |
|
| 31 | } |
|
| 32 | ||
| 33 | $roleLimitationConverter = $container->getDefinition('ezpublish.persistence.legacy.role.limitation.converter'); |
|
| 34 | ||
| 35 | foreach ($container->findTaggedServiceIds('ezpublish.persistence.legacy.role.limitation.handler') as $id => $attributes) { |
|
| 36 | foreach ($attributes as $attribute) { |
|
| 37 | $roleLimitationConverter->addMethodCall( |
|
| 38 | 'addHandler', |
|
| 39 | array(new Reference($id)) |
|
| 40 | ); |
|
| 41 | } |
|
| 42 | } |
|
| 43 | } |
|
| 44 | } |
|
| 45 | ||