kheang
(Ken)
1
Hi I was wondering with "Relational Active Record" is it possible to update different linked tables?
Example, I have a table linked with another through ONE to MANY.
Could I simply fetch the record, set my changes to the attributes and call save() and have it update all rows?
Is that possible or do I need to do the main and then loop through each record of the child and update them individually?
Thanks!
samdark
(Alexander Makarov)
2
With core Yii you have to loop through each record. There are useful community powered extensions for AR that can do this job for you:
http://www.yiiframework.com/extension/save-relations-ar-behavior/
http://www.yiiframework.com/extension/cadvancedarbehavior/
kheang
(Ken)
3
Thanks I will check it out!
sluderitz
(Sluderitz)
4