I am just learning Magento from the book Magento for PHP Devs but when I tried to recreate this code I got an error: PHP warning: include(Mage/Mdg/Giftregistry/Model/Entity.php): failed to open stream: No such file or directory in /var/www/html/learn/lib/Varien/Autoload.php on line 94
Due I have no experience I require some help. I have flushed Cache several times and still don't get it right. This is some data.
The error happens when I try to create a new model: $registry = Mage::getModel('mdg_giftregistry/entity');
ERROR: PHP warning: include(Mage/Mdg/Giftregistry/Model/Entity.php): failed to open stream: No such file or directory in /var/www/html/learn/lib/Varien/Autoload.php on line 94
Im using magerun netz98. Maybe this has something to do?
My files:
app/etc/modules/Mdg_Giftregistry.xml
<?xml version="1.0"?>
<config>
<modules>
<Mdg_Giftregistry>
<active>true</active>
<codePool>local</codePool>
</Mdg_Giftregistry>
</modules>
app/code/local/Mdg/Giftregistry/etc/config.xml:
<?xml version="1.0"?>
<config>
<modules>
<Mdg_Giftregistry>
<version>0.2.0</version>
</Mdg_Giftregistry>
</modules>
<global>
<models>
<mdg_giftregistry>
<class>Mdg_Giftregistry_Model</class>
</mdg_giftregistry>
</models>
<blocks>
<mdg_giftregistry>
<class>Mdg_Giftregistry_Block</class>
</mdg_giftregistry>
</blocks>
<helpers>
<mdg_giftregistry>
<class>Mdg_Giftregistry_Helper</class>
</mdg_giftregistry>
</helpers>
<resources>
<mdg_giftregistry_setup>
<setup>
<module>Mdg_Giftregistry</module>
</setup>
</mdg_giftregistry_setup>
</resources>
</global>
</config>
app/code/local/Mdg/Giftregistry/Model/Entity.php :
<?php
class Mdg_Giftregistry_Model_Entity extends Mage_Core_Model_Abstract {
public function __construct() {
$this->_init('mdg_giftregistry/entity');
parent::_construct();
}
}
Any suggestion?