title: Magento model collections - save data
body: <p>So I'm loading a collection of products using this code:</p>
  
  <pre><code>$magento_time= 'some time string';
  $collection = Mage::getModel('catalog/product')-&gt;getCollection();
  $collection-&gt;addFieldToFilter(array(
      array('attribute'=&gt; 'updated_at', 'gt'=&gt; date('Y-m-d H:i:s', strtotime($magento_time))),
  ));    
  $collection-&gt;save();
  </code></pre>
  
  <p>And getting this error in return on save:</p>
  
  <pre><code>Warning: Invalid argument supplied for foreach()  in /var/www/magento/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 970
  
  #0 /var/www/magento/app/code/core/Mage/Eav/Model/Entity/Abstract.php(970): mageCoreErrorHandler(2, 'Invalid argumen...', '/var/www/magent...', 970, Array)
  #1 /var/www/magento/app/code/core/Mage/Eav/Model/Entity/Abstract.php(925): Mage_Eav_Model_Entity_Abstract-&gt;_collectSaveData(Object(Mage_Catalog_Model_Product))
  #2 /var/www/magento/app/code/core/Mage/Core/Model/Abstract.php(251): Mage_Eav_Model_Entity_Abstract-&gt;save(Object(Mage_Catalog_Model_Product))
  #3 /var/www/magento/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php(845): Mage_Core_Model_Abstract-&gt;save()
  #4 /var/www/magento/app/code/local/MyModule/controllers/IndexController.php(16): Mage_Eav_Model_Entity_Collection_Abstract-&gt;save()
  #5 /var/www/magento/app/code/core/Mage/Core/Controller/Varien/Action.php(376): MyModule_IndexController-&gt;sayHelloAction()
  #6 /var/www/magento/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(248): Mage_Core_Controller_Varien_Action-&gt;dispatch('sayHello')
  #7 /var/www/magento/app/code/core/Mage/Core/Controller/Varien/Front.php(158): Mage_Core_Controller_Varien_Router_Standard-&gt;match(Object(Mage_Core_Controller_Request_Http))
  #8 /var/www/magento/app/Mage.php(459): Mage_Core_Controller_Varien_Front-&gt;dispatch()
  #9 /var/www/magento/index.php(68): Mage::run()
  #10 {main}
  </code></pre>
  
  <p>How do I save products back to the database after they've been loaded into a collection?</p>