getSingleton in magento

Mage::getSingleton()

Mage::getSingleton() will 1st  check the same class instance is exits or not in memory. If the instance is created then it will return the same object from memory.
So Mage::getSingleton() faster then Mage::getModel().

$ikodes= Mage::getSingleton('catalog/product');
$ikodes1 = Mage::getSingleton('catalog/product');

Related posts