Вопрос

load by Id

$data = Mage::getModel('module_name/model)->load($id);

or

//collection by filter

$data = Mage::getModel('module_name/model)->getCollection()->addFieldToFilter('id',$id);
Это было полезно?

Решение

The proper method to get single record : Mage::getModel('module_name/model)->load($id);

If you use getCollection() then it will load all the record of that particular table and then it will filter the record from all collection.

While load() will fetch only single record from that table.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с magento.stackexchange
scroll top