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