Archive » August 2015

What is the difference between $model->getData() and $model->getOrigData(); methods in Magento?

Magento

$model->getOrigData() returns the data that was originally loaded from the database when you initialized the model object and called $model->load() method. After loading the model you may have performed certain updates to the $model object calling methods like $model->setData(). $model->getData() return the $model object data in the present state.

Magento models extend the class ‘Mage_Core_Model_Abstract’ which in turn extends the class ‘Varien_Object’. The methods getData() and getOrigData() have been defined in the class ‘Varien_Object’.

Continue reading »

Back to top