Answer the question
In order to leave comments, you need to log in
How to implement an event feed?
In general, there is CRM, there are deals / contacts, implemented in Yii.
Until recently, a deal/contact needed the ability to attach only comments or files.
Now you need to attach, for example, a task or any other entity.
Now I see the structure of the event table as follows:
id, model, model_id, entity, entity_id, time_create
where
model is the class of the model to which the entity is attached (contact / deal)
entity is the class of the entity that is attached to the model (comment, file, deal)
now question - is it possible to somehow use relations in yii with the current structure to get attached entities?
or it is necessary to use sql with join'om all the same?
Answer the question
In order to leave comments, you need to log in
Do you think 1:1 attachment happens without join? The question is rather whether you want to load all related data in one request or use lazy loading through relations?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question