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.
* Mass update the current collection with the same data
* @param $data
* @return int
public function massUpdate(array $data)
$this->getConnection()->update($this->getResource()->getMainTable(), $data, $this->getResource()->getIdFieldName() . ' IN(' . implode(',', $this->getAllIds()) . ')');
This function allows you to easily call massUpdate(array()), which in turn updates all the current loaded rows with the specified data.
$collection = Mage::getResourceModel('your_module/entity_collection')->addFieldToFilter('id', array('in' => $someArray));
$collection->massUpdate(array('status' => 1));
This will only work on flat tables and not any form of data which is stored within EAV.