AR and Bulk operations (updateAll / deleteAll)

Hi !

I started using Yii for the first time today and I was just wondering if it is possible to apply bulk operations (using updateAll or deleteAll) on AR Models in conjunction with the with() method.

It seems that the with() method returns a CActiveFinder Object on witch it is impossible to apply other methods than find***().

For instance, I’d like to delete all records with a specific condition on a related model.

Is there any solution to my problem ? Thanks in advance for your help !



is my question so stupid ?



the stupid way I’d do that, would be iterating through the results of the find, that is nonetheless the same as performing multiple delete of rows.

Thanks "The peach" :-). However I was thinking about a direct query (so without iterating a resultset)… and it seems to be impossible :frowning:

Why no extend ActiveRecord and create some method to accomplish that?

Or better with behaviors!!!