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

ValueObjectVisitorPass.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Bundle\EzPublishRestBundle\DependencyInjection\Compiler;
8
9 use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
10 use Symfony\Component\DependencyInjection\ContainerBuilder;
11 use Symfony\Component\DependencyInjection\Reference;
12
17 class ValueObjectVisitorPass implements CompilerPassInterface
18 {
19 public function process(ContainerBuilder $container)
20 {
21 if (!$container->hasDefinition('ezpublish_rest.output.value_object_visitor.dispatcher')) {
22 return;
23 }
24
25 $definition = $container->getDefinition('ezpublish_rest.output.value_object_visitor.dispatcher');
26
27 foreach ($container->findTaggedServiceIds('ezpublish_rest.output.value_object_visitor') as $id => $attributes) {
28 foreach ($attributes as $attribute) {
29 if (!isset($attribute['type'])) {
30 throw new \LogicException('ezpublish_rest.output.value_object_visitor service tag needs a "type" attribute to identify the field type. None given.');
31 }
32
33 $definition->addMethodCall(
34 'addVisitor',
35 [$attribute['type'], new Reference($id)]
36 );
37 }
38 }
39 }
40 }
eZ\Bundle\EzPublishRestBundle\DependencyInjection\Compiler\ValueObjectVisitorPass
Compiler pass for the ezpublish_rest.output.value_object_visitor tag.
Definition: ValueObjectVisitorPass.php:18
eZ\Bundle\EzPublishRestBundle\DependencyInjection\Compiler\ValueObjectVisitorPass\process
process(ContainerBuilder $container)
Definition: ValueObjectVisitorPass.php:19
eZ\Bundle\EzPublishRestBundle\DependencyInjection\Compiler
Definition: FieldTypeProcessorPass.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.