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

FieldValueConverterRegistryPass.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\Base\Container\Compiler\Storage\Legacy;
8
9 use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
10 use Symfony\Component\DependencyInjection\ContainerBuilder;
11 use Symfony\Component\DependencyInjection\Exception\LogicException;
12 use Symfony\Component\DependencyInjection\Reference;
13
17 class FieldValueConverterRegistryPass implements CompilerPassInterface
18 {
22 public function process(ContainerBuilder $container)
23 {
24 if (!$container->hasDefinition('ezpublish.persistence.legacy.field_value_converter.registry')) {
25 return;
26 }
27
28 $registry = $container->getDefinition('ezpublish.persistence.legacy.field_value_converter.registry');
29
30 foreach ($container->findTaggedServiceIds('ezpublish.storageEngine.legacy.converter') as $id => $attributes) {
31 foreach ($attributes as $attribute) {
32 if (!isset($attribute['alias'])) {
33 throw new LogicException('ezpublish.storageEngine.legacy.converter service tag needs an "alias" attribute to identify the field type. None given.');
34 }
35
36 $registry->addMethodCall(
37 'register',
38 [
39 $attribute['alias'],
40 new Reference($id),
41 ]
42 );
43 }
44 }
45 }
46 }
eZ\Publish\Core\Base\Container\Compiler\Storage\Legacy\FieldValueConverterRegistryPass
This compiler pass will register Legacy Storage field value converters.
Definition: FieldValueConverterRegistryPass.php:18
eZ\Publish\Core\Base\Container\Compiler\Storage\Legacy\FieldValueConverterRegistryPass\process
process(ContainerBuilder $container)
Definition: FieldValueConverterRegistryPass.php:22
eZ\Publish\Core\Base\Container\Compiler\Storage\Legacy
Definition: FieldValueConverterRegistryPass.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.