2 edited tags
| link
1
source | link

Magento load huge collection

I tried to do what all the person have done without problems

$customers = Mage::getModel('customer/customer')->getCollection()->addAttributeToSelect(array('email'), 'inner');
Mage::getSingleton('core/resource_iterator')->walk($customers->getSelect(), array(array($this, 'customerCallback')));


function customerCallback($args)
{
    $customer = Mage::getModel('customer/customer'); // get customer model
    $customer->setData($args['row']); // map data to customer model
    echo $customer->getFirstname(); // set value of firstname attribute
}

But, for me, it doesn't works an i don't know why. The error is:

PHP Fatal error:  Uncaught exception 'Exception' with message 'Warning: call_user_func() expects parameter 1 to be a valid callback, first array member is not a valid class name or object