I have a situation where I need to deal with a grouping of data.
My normal AR models are Course, CourseCategory, Questionnaire, and QuestionnaireSurvey.
I’ve built reports that deal with data from each of those models, but now I have to build a report that represents data accumulated from those tables, i.e. - the aggregate results of QuestionnaireSurvey responses.
Instead of having to build custom queries to deal with the data, I would much rather be able to query the data using model associations, and still have the benefit of AR record fetching as well, for relations.
Is there a Yii method to create a model that represents the aggregation of this data while allowing full AR functionality (aside from create/update records, as this is read-only)?