I am trying to ues a resource model and get the following when I try to load it:
Warning: include(Mage\Core\Resource\Model.php): failed to open stream: No such file or directory in C:\xampp\htdocs\magento\lib\Varien\Autoload.php on line 93
My controller action looks like:
$blogpost = Mage::getModel("test/blogpost");
$blogpost->load(1);
My config.xml
looks like:
<?xml version="1.0"?>
<config>
<modules>
<Lock_Test>
<version>1.0.0</version>
</Lock_Test>
</modules>
<global>
<models>
<test>
<class>Lock_Test_Model</class>
<resourceModel>test_resource</resourceModel>
</test>
<test_resource>
<class>Lock_Test_Model_Resource</class>
</test_resource>
</models>
</global>
<frontend>
<routers>
<lock_router>
<use>standard</use>
<args>
<module>Lock_Test</module>
<frontName>test</frontName>
</args>
</lock_router>
</routers>
</frontend>
</config>
I have no idea why it is trying to load from the Mage
directory. I can't see anything wrong with my config file.
I'm loosly following this tutorial, although I haven't created the entities and table name above, I would think it should still find my Resource Model.
Please help!
app\code\local\Lock\Test\Model\Blogpost.php
look like:
<?php
class Lock_Test_Model_Blogpost extends Mage_Core_Model_Abstract
{
protected function _construct()
{
$this->_init("test/blogpost");
}
}
app\code\local\Lock\Test\Model\Resource\Blogpost.php
looks like:
<?php
class Lock_Test_Model_Resource_Blogpost extends Mage_Core_Resource_Model
{
protected function _construct()
{
$this->_init("test/blogpost", "blogpost_id");
}
}