I've been following this tutorial about Magento's Model and ORM basics too. I'm using Magento Version 1.5.0, and when i came across on testing the model if it works specially in printing the object in this code, all i get is a blank white page.
public function testModelAction() {
$blogpost = Mage::getModel('weblog/blogpost');
echo get_class($blogpost);
}
I went to see the system log and i get these errors
2011-02-16T04:18:27+00:00 ERR (3): Warning: include(Alanstormdotcom\Weblog\Model\Blogpost.php) [function.include]: failed to open stream: No such file or directory in E:\xampp\htdocs\magento\lib\Varien\Autoload.php on line 94
2011-02-16T04:18:27+00:00 ERR (3): Warning: include() [function.include]: Failed opening 'Alanstormdotcom\Weblog\Model\Blogpost.php' for inclusion (include_path='E:\xampp\htdocs\magento\app\code\local;E:\xampp\htdocs\magento\app\code\community;E:\xampp\htdocs\magento\app\code\core;E:\xampp\htdocs\magento\lib;.;E:\xampp\php\PEAR') in E:\xampp\htdocs\magento\lib\Varien\Autoload.php on line 94
2011-02-16T04:18:27+00:00 ERR (3): Warning: get_class() expects parameter 1 to be object, boolean given in E:\xampp\htdocs\magento\app\code\local\Alanstormdotcom\Weblog\controllers\IndexController.php on line 6
Hope you can help me in resolving this problem..
Thank you..
What sort of bum writes a tutorial that doesn't work?!
Take a look at your error message
Magento is telling you it can't find your model file. Have you created the model named Blogpost.php? Is it in the right folder? It should be at
If Magento can't find it, that means it's not there. If it is there, than means someone's monkeied with your include path.