logged user can had/remove a content to it’s favorites. There is multiple types of contents (news, article, other user…)
user can list it’s favorites
user can list someone else favorites
user can list overall favorites
First I attached a behavior to user (so he could add/delete/list he’s own favorite). But I also have to create a model and a controller to favorite. So Things are splitted behavior + model/controler , i think that’s a bad design.
So maybe it’s better to attach a FavoriteBehavior to contents …
But maybe i should implement a module (+ a behavior ?) ?
In fact, i know how to user providers, controlers, etc.
I was just wondering "Should i code a behavior, a module, etc."
Finaly i think i’ll make 2 behaviors. one attached to user (so he can add/remove favorites) and one attached to content models (for afterSave & afterDelete action (so favorites are removed if content gets deleted or unpublished).
I’ll put everything (favorite model, controller, views & behaviors) in a module, that way it will be easier to activate or deactive the favorites related actions, models, etc…