Tag » Posts Tagged ‘Log’

What is the difference between $model->getData() and $model->getOrigData(); methods in 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 »

Clean up Magento database logs for Faster Performance

Database Optimization

Magento maintains several log tables for tracking purpose like customer access, products viewed, products compared etc. These tables grow in size day by day so if you have a large numbers of visitors on your website the size of these log tables may become large enough within a week slowing down your database. So you should perform database log cleaning on a regular basis – daily/weekly/monthly depending upon your website traffic.

There are three ways to clean out these tables:

1. Log Cleaning in the Magento Admin

2. Shell Utility log.php in the ../shell directory, and

3. Manually via phpMyAdmin or mysql client

Continue reading »

Back to top