December 10, 2015
Magento: Mage::getResourceModel, Mage::getModel 和 Mage::getSingleton() 的区别 when to use Mage::getResourceModel, Mage::getModel and Mage::getSingleton()
Perfect differece with example for getsingleton and getmodel.
Mage::getSingleton()
Mage::getSingleton() will first check if the same class instance exists or not in the memory. If the instance exists then it will return the same object from the memory. So Mage::getSingleton() is faster than Mage::getModel().
Example
$product1 = Mage::getSingleto… Read More