I read and following this guide
But this error :
Fatal error: Call to a member function load() on a non-object in C:\wamp\www\Ishop\app\code\core\Mage\Core\Model\Abstract.php on line 225
this is config.xml
<models>
<weblog>
<class>Magentotutorial_Weblog_Model</class>
<resourceModel>weblog_resource</resourceModel>
</weblog>
<weblog_resource>
<class>Magentotutorial_Weblog_Model_Resource</class>
<entities>
<blogpost>
<table>blog_posts</table>
</blogpost>
</entities>
</weblog_resource>
</models>
I added table with name is blog_posts. I am a newbie with Magento. Is the way to debug this issue? I think error in config.xml file. but I review it several times, still don't find error.
It seems like there's a problem within one of your models.
You should have a file app/code/local/Magentotutorial/Weblog/Model/Blogpost.php:
<?php
class Magentotutorial_Weblog_Model_Blogpost extends Mage_Core_Model_Abstract
{
protected function _construct()
{
$this->_init('weblog/blogpost');
}
}
?>
And a file app/code/local/Magentotutorial/Weblog/Model/Resource/Blogpost.php:
<?php
class Magentotutorial_Weblog_Model_Resource_Blogpost extends Mage_Core_Model_Resource_Db_Abstract{
protected function _construct()
{
$this->_init('weblog/blogpost', 'blogpost_id');
}
}
?>
And a file app/code/local/Magentotutorial/Weblog/Model/Resource/Blogpost/Collection.php:
<?php
class Magentotutorial_Weblog_Model_Resource_Blogpost_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract {
protected function _construct()
{
$this->_init('weblog/blogpost');
}
}
?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With