Answer the question
In order to leave comments, you need to log in
How to properly get data from Magento model?
Problem with getting data from the Model (Magento Full Release - ver 1.9.2.4).
I get the model in the action
controller:
$news = Mage::getModel('dev_news/news')->getCollection();
foreach ($news as $item) {
echo $item->getId()
}
Fatal error: Uncaught Error: Call to a member function order() on null in /home/vitaliy/hosts/module.dev/lib/Varien/Data/Collection/Db.php:506 Stack trace: #0
Answer the question
In order to leave comments, you need to log in
At you in other place an error to a campaign. Turn on developer mode and see where the error is
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question