@@ -43,28 +43,12 @@ before the bundle one).
43
43
Services & Configuration
44
44
------------------------
45
45
46
- If you want to modify service definitions of another bundle, you can use a compiler
47
- pass to change the class of the service or to modify method calls. In the following
48
- example, the implementing class for the ``original-service-id `` is changed to
49
- ``Acme\DemoBundle\YourService ``::
50
-
51
- // src/Acme/DemoBundle/DependencyInjection/Compiler/OverrideServiceCompilerPass.php
52
- namespace Acme\DemoBundle\DependencyInjection\Compiler;
53
-
54
- use Acme\DemoBundle\YourService;
55
- use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
56
- use Symfony\Component\DependencyInjection\ContainerBuilder;
57
-
58
- class OverrideServiceCompilerPass implements CompilerPassInterface
59
- {
60
- public function process(ContainerBuilder $container)
61
- {
62
- $definition = $container->getDefinition('original-service-id');
63
- $definition->setClass(YourService::class);
64
- }
65
- }
66
-
67
- For more information on compiler passes, see :doc: `/service_container/compiler_passes `.
46
+ If you want to modify the services created by a bundle, you can use
47
+ :doc: `service decoration </service_container/service_decoration >`.
48
+
49
+ If you want to do more advanced manipulations, like removing services created by
50
+ other bundles, you must work with :doc: `service definitions </service_container/definitions >`
51
+ inside a :doc: `compiler pass </service_container/compiler_passes >`.
68
52
69
53
Entities & Entity Mapping
70
54
-------------------------
0 commit comments