From fa1755511165d85c6d61a2701866e1cbd5c3fe1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig=20N=C3=B8rgaard=20F=C3=A6rch?= Date: Fri, 8 Nov 2024 16:10:02 +0100 Subject: [PATCH] [DOC] ProxyClassGenerator - exclude class from dependency injection --- .../ExtendNews/ProxyClassGenerator/Index.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Documentation/Tutorials/ExtendNews/ProxyClassGenerator/Index.rst b/Documentation/Tutorials/ExtendNews/ProxyClassGenerator/Index.rst index 42b6e9f302..3b3aff94e7 100644 --- a/Documentation/Tutorials/ExtendNews/ProxyClassGenerator/Index.rst +++ b/Documentation/Tutorials/ExtendNews/ProxyClassGenerator/Index.rst @@ -159,6 +159,23 @@ As the class :php:`Domain/Model/News` should be extended, create a file at the s } } +3) Exclude the class from dependecy injection +_________________________________________ + +As the class you define will be added to a new generated class, the class needs to be excluded from dependency injection in Configuration/Services.yaml: + +.. code-block:: yaml + + services: + _defaults: + autowire: true + autoconfigure: true + public: false + + GeorgRinger\Eventnews\: + resource: '../Classes/*' + exclude: '../Classes/Domain/Model/*' + .. hint:: If you are using the extension :file:`extension_builder`, this class might have been created for you already.