Update all entities/rows within a Magento collection

I ran into an issue when I was attempting to update every row within a collection I had previously loaded. The only method I could easily see to do this directly on the collection was via a foreach loop with a save after each setData/addData.

There are other methods throughout Magento to update individual product attributes and other data, but if you’re wanting to call a simple update function on a collection you can implement the following function into your collection resource model.