Are there side-effects, or issues with doing something like this:
// Retrieve the Model once
$model = Mage::getModel('some/model';
// Load several different instances
foreach($idlist as $id)
{
$entity = $model->load($id);
}
Or should the Model be retrieved within the loop?
// Load several different instances
foreach($idlist as $id)
{
// Retrieve the Model once per instance
$model = Mage::getModel('some/model';
$entity = $model->load($id);
}
Mage::getModel('some/model')->getCollection()->addAttributeToFilter('entity_id' -> array('in', array(1,2,3))?We usually do it that way, this question was specific to one to many vs one to one getModel():load() calls--so a foreach better demonstrated it.
– STW Jun 26 '14 at 19:47