How do I mass update a model with specified conditions?
e.g., "update table set col=newvalue where this=that and ..."
Based on the docs, doesn't look like I can pass in a conditions array, so will I just have to resort to manual SQL here?
kirk bushellTue Dec 07 17:22:38 -0500 2010
All the saving methods are specific to an individual record. Any form of batch-updating I do not believe is yet available. So yes, you'll need to use manual SQL.
Subject: Applying conditions to Model::update_attributes?
I was looking up the Model::update_attributes function in the docs: http://www.phpactiverecord.xyz/docs/ActiveRecord/Model#methodupdate_attributes
How do I mass update a model with specified conditions?
e.g., "update table set col=newvalue where this=that and ..."
Based on the docs, doesn't look like I can pass in a conditions array, so will I just have to resort to manual SQL here?