I couldn't find a satisfactory approach to loading data from a join table at the same time as loading the joined objects. In other words, A and B are joined via J and J has some pertinent data that should load automatically when an A object loads its Bs.
My first stab at a general solution is in the form of an extension to CActiveRecord. In the GitHub repository below it is in the context of a standard yiic webapp.
If you are interested, take a look at it. The README serves as an intro and points out where the extension, example models and unit tests lie. The extension itself has plenty of PHPdoc comments.
https://github.com/t.../Movie-Watchers
As a Yii beginner I would welcome comments.
If you think it's worth developing into something that others could use, please suggest what would have to change.
Page 1 of 1
An extension of CActiveRecord for loading data out of join tables
#1
Posted 09 November 2011 - 08:01 PM
Join the happiest place on Freenode: #yii
We've got a YiiBot and all kinds of other groovy stuff going on.
Comparison of Internet Relay Chat clients
Web IRC client
We've got a YiiBot and all kinds of other groovy stuff going on.
Comparison of Internet Relay Chat clients
Web IRC client
Share this topic:
Page 1 of 1

Help












