V
V
v0lume2014-12-10 20:38:37
Yii
v0lume, 2014-12-10 20:38:37

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

1 answer(s)
A
Anton Shamanov, 2014-12-14
@SilenceOfWinter

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 question

Ask a Question

731 491 924 answers to any question