Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
Why does switching from annotation to attribute disables tagging and service creation for entities#61124
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
I'm in the process of updating a product to Symfony 6.4 from Symfony 5.4. Now I have a rather curious behaviour that I can't explain. This product uses some tagged iterators to collect declared classes. Some of theses classes are doctrine entities. All of this works fine in 5.4 and 6.4, if I'm using annotations to mark the entity The moment I switch to attribute Am I doing something wrong? Is this behaviour intended? I couldn't find any documentation for this. |
BetaWas this translation helpful?Give feedback.
All reactions
Replies: 1 comment 7 replies
-
Doctrine entities have been excluded from the container by#59987 (amongst others) because they are not services. What is your use-case? |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Makes no difference, because then I would need a list of these persisted configuration objects... |
BetaWas this translation helpful?Give feedback.
All reactions
-
I thought placeholders would be able to fetch their own configuration 🤷 |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
It's not the fetching, that's the problem. To create a new placeholder of a certain type, I need an admin class for SonataAdmin and that will need a referenced entity class. To get a selection of possible placeholders on the admin backend to create a new entry, I need a list with these entities (and there admin class, but that's not important right now). Also, this is not our only bundle that is affected. |
BetaWas this translation helpful?Give feedback.
All reactions
-
this looks like a use case for |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
OK, that's fine for Symfony 7.3, but that doesn't help in Symfony 6.4, where this feature doesn't exists. Will this be backported? Because without it, the changes to doctrine-bundle to exclude Entities are without a resolution, as far as I understand it. Also, is the CompilerPass the only way to get the list, or do the tagged iterators work on resource tags? |
BetaWas this translation helpful?Give feedback.