Jasper Tey Mon Dec 06 02:35:02 -0500 2010

Subject: Applying conditions to Model::update_attributes?

I was looking up the Model::update_attributes function in the docs: http://www.phpactiverecord.org/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?


kirk bushell Tue 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.

(1-1/1)