Magento Engineer
social
Journal

What is the difference between Mage::getSingletone() and Mage::getModel() in Magento ?

Mage::getSingletone() : This method always finds for an existing object if not then create that a new object.

Mage::getModel() :This method always creates a new object.

How to Use Mage::getSingleton()
$contrCol1 = Mage::getSingleton('directory/country_collection');

How to Use Mage::getModel()
$contrCol1 = Mage::getModel('directory/country_collection');

Ad comes here
Comments
  • hello
    7 years ago

    some content

  • nfjsanj
    2026 years ago

    hfjhdjsafhjds fh

Leave A Comment
PHP blog
Update Cookies Preferences