Vladislav Rastrusny
Vladislav Rastrusny

Reputation: 29985

Dynamic fields/properties in Doctrine2 - how?

I I would like plugins to be able to add properties to my models. For example, I have a model "Message". A "Like" plugin can add property "likedtimes" to it and maintain it. How can I get such functionality?

One solution is to create a separate table and model for likes. But that would require a join or additional select whenever likes are to be displayed.

Upvotes: 4

Views: 2861

Answers (1)

Cobby
Cobby

Reputation: 5454

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

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

FYI: Difference between entities and models

Upvotes: 3

Related Questions