Dynamic fields / properties in Doctrine2 - how?

I would like plugins to add properties to my models. For example, I have a Message model. The How plugin can add a like property to it and support it. How can I get this functionality?

One solution is to create a separate table and model for the likes. But this requires a connection or an additional choice when you need to display the ones you like.

+4
source share
1 answer

Are you trying to reproduce common functionality between Entities (not models)?

If so, I would recommend that you implement your own behavior using the built-in event system.

FYI: The difference between objects and models

+3
source

Source: https://habr.com/ru/post/1337161/


All Articles