我正在尝试创建一个EAV模块,并且我在这里停留了很长时间。
错误消息:
Invalid entity_type specified: gagan_eavfaq
#0 C:\wamp\www\www.ubt.com\app\code\core\Mage\Eav\Model\Config.php(328): Mage::throwException('Invalid entity_...')
#1 C:\wamp\www\www.ubt.com\app\code\core\Mage\Eav\Model\Entity\Abstract.php(276): Mage_Eav_Model_Config->getEntityType('gagan_eavfaq')
#2 C:\wamp\www\www.ubt.com\app\code\local\Gagan\Eavfaq\Model\Resource\Eav\Mysql4\Eavfaq.php(9): Mage_Eav_Model_Entity_Abstract->setType('gagan_eavfaq')
#3 C:\wamp\www\www.ubt.com\app\code\core\Mage\Core\Model\Resource\Abstract.php(44): Gagan_Eavfaq_Model_Resource_Eav_Mysql4_Eavfaq->_construct()
#4 C:\wamp\www\www.ubt.com\app\code\core\Mage\Core\Model\Config.php(1348): Mage_Core_Model_Resource_Abstract->__construct(Array)
#5 C:\wamp\www\www.ubt.com\app\code\core\Mage\Core\Model\Config.php(1380): Mage_Core_Model_Config->getModelInstance('eavfaq_mysql4/e...', Array)
#6 C:\wamp\www\www.ubt.com\app\Mage.php(490): Mage_Core_Model_Config->getResourceModelInstance('eavfaq/eavfaq', Array)
#7 C:\wamp\www\www.ubt.com\app\Mage.php(518): Mage::getResourceModel('eavfaq/eavfaq', Array)
#8 C:\wamp\www\www.ubt.com\app\code\core\Mage\Core\Model\Abstract.php(139): Mage::getResourceSingleton('eavfaq/eavfaq')
#9 C:\wamp\www\www.ubt.com\app\code\core\Mage\Core\Model\Abstract.php(225): Mage_Core_Model_Abstract->_getResource()
#10 C:\wamp\www\www.ubt.com\app\code\local\Gagan\Eavfaq\controllers\IndexController.php(8): Mage_Core_Model_Abstract->load(1)
#11 C:\wamp\www\www.ubt.com\app\code\core\Mage\Core\Controller\Varien\Action.php(419): Gagan_Eavfaq_IndexController->indexAction()
#12 C:\wamp\www\www.ubt.com\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#13 C:\wamp\www\www.ubt.com\app\code\core\Mage\Core\Controller\Varien\Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#14 C:\wamp\www\www.ubt.com\app\code\core\Mage\Core\Model\App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#15 C:\wamp\www\www.ubt.com\app\Mage.php(683): Mage_Core_Model_App->run(Array)
#16 C:\wamp\www\www.ubt.com\index.php(87): Mage::run('', 'store')
#17 {main}
配置:
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<Gagan_eavfaq>
<version>0.1.0</version>
</Gagan_eavfaq>
</modules>
<frontend>
<routers>
<eavfaq>
<use>standard</use>
<args>
<module>Gagan_Eavfaq</module>
<frontName>eavfaq</frontName>
</args>
</eavfaq>
</routers>
</frontend>
<global>
<models>
<eavfaq>
<class>Gagan_Eavfaq_Model</class>
<resourceModel>eavfaq_mysql4</resourceModel>
</eavfaq>
<eavfaq_mysql4>
<class>Gagan_Eavfaq_Model_Resource_Eav_Mysql4</class>
<entities>
<dinkchika>
<table>gagan_eavfaq</table>
</dinkchika>
</entities>
</eavfaq_mysql4>
</models>
<resources>
<eavfaq_setup>
<setup>
<module>Gagan_Eavfaq</module>
<class>Gagan_Eavfaq_Entity_Setup</class>
</setup>
<connection>
<use>core_setup</use>
</connection>
</eavfaq_setup>
<eavfaq_write>
<connection>
<use>core_write</use>
</connection>
</eavfaq_write>
<eavfaq_read>
<connection>
<use>core_read</use>
</connection>
</eavfaq_read>
</resources>
</global>
</config>
资源:
<?php
class Gagan_Eavfaq_Model_Resource_Eav_Mysql4_Eavfaq
extends Mage_Eav_Model_Entity_Abstract
{
public function _construct() {
$resource = mage::getSingleton('core/resource');
$this->setType('gagan_eavfaq');
$this->setConnection(
$resource->getConnection('eavfaq_read'),
$resource->getConnection('eavfaq_write')
);
}
}
设置:
<?php
class Gagan_Eavfaq_Entity_Setup extends
Mage_Eav_Model_Entity_Setup{
}
安装脚本: 我想要显示此异常。看起来我的设置没有找到这个文件的方法,由此我可以得出结论我的配置有问题。但我已经检查过几次仍然没有运气。请帮忙。谢谢
<?php $installer = $this;
throw new Exception("set up configured ");
文件夹结构: