KnpLabs / KnpRadBundle

Rapid Application Development for Symfony2 [UNMAINTAINED]

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[critical] Services load before repositories definition

Nek- opened this issue · comments

The following line of code load every services (except scoped services or tagged services). So you can't use repository services for your basicals services.
https://github.com/KnpLabs/KnpRadBundle/blob/develop/DependencyInjection/Compiler/RegisterDoctrineRepositoriesPass.php#L33

You also can't define repositories as service by yourself because you get a circular reference of services.

can you provide an example please ?

So i'll be able to define this use case in behat suite, and avoid any regression.

thanks BTW :)

Here is an example:

    app.parameter.provider:
        class: App\Provider\ParameterProvider
        arguments:
            - @app.entity.parameter_repository

    app.mailer.template.loader:
        class: App\Mailer\TemplateLoader
        arguments: [ @app.parameter.provider ]
        calls:
            - [setContainer, ['@service_container']]