In my custom module, while setting sql_setup i got this error,
Can't retrieve entity config: membership/members"
Error Report:
a:5:{i:0;s:163:"Error in file: "C:\xampp\htdocs\ems\app\code\local\Att\Membership\sql\membership_setup\mysql4-install-1.0.0.php" - Can't retrieve entity config: membership/members";i:1;s:908:"#0 C:\xampp\htdocs\ems\app\code\core\Mage\Core\Model\Resource\Setup.php(645): Mage::exception('Mage_Core', 'Error in file: ...')
1 C:\xampp\htdocs\ems\app\code\core\Mage\Core\Model\Resource\Setup.php(421):
Mage_Core_Model_Resource_Setup->_modifyResourceDb('install', '', '1.0.0')
2 C:\xampp\htdocs\ems\app\code\core\Mage\Core\Model\Resource\Setup.php(327):
Mage_Core_Model_Resource_Setup->_installResourceDb('1.0.0')
3 C:\xampp\htdocs\ems\app\code\core\Mage\Core\Model\Resource\Setup.php(235):
Mage_Core_Model_Resource_Setup->applyUpdates()
4 C:\xampp\htdocs\ems\app\code\core\Mage\Core\Model\App.php(417): Mage_Core_Model_Resource_Setup::applyAllUpdates()
5 C:\xampp\htdocs\ems\app\code\core\Mage\Core\Model\App.php(343): Mage_Core_Model_App->_initModules()
6 C:\xampp\htdocs\ems\app\Mage.php(683): Mage_Core_Model_App->run(Array)
7 C:\xampp\htdocs\ems\index.php(93): Mage::run('', 'store')
8 {main}";s:3:"url";s:5:"/ems/";s:11:"script_name";s:14:"/ems/index.php";s:4:"skin";s:7:"default";}
config file:
<models>
<membership>
<class>Att_Membership_Model</class>
<resoursemodel>membership_mysql4</resoursemodel>
</membership>
<membership_mysql4>
<class>Att_Membership_Model_Mysql4</class>
<entities>
<members>
<table>membership</table>
</members>
</entities>
</membership_mysql4>
</models>
<resources>
<membership_setup>
<setup>
<module>Att_Membership</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</membership_setup>
<membership_write>
<connection>
<use>core_write</use>
</connection>
</membership_write>
<membership_read>
<connection>
<use>core_read</use>
</connection>
</membership_read>
</resources>
controller file:
class Att_Membership_indexController extends
Mage_Core_Controller_Front_Action{
public function viewAction(){
$params = $this->getRequest()->getParams();
$prefs = Mage::getModel('membership/members');
echo ("Loading the blogpost with an Id of " . $params['id']);
$prefs->load($params['id']);
$data = $prefs->getData();
var_dump($data);
} }
mysql setup file : mysql4-install-1.0.0.php
$installer = $this;
$installer->startSetup();
$installer->run("
DROP TABLE IF EXISTS {$installer->getTable('membership/members')};
CREATE TABLE {$installer->getTable('membership/members')} (
memberid int(11) NOT NULL auto_increment,
name text,
type text,
date datetime default NULL,
timestamp timestamp NOT NULL default CURRENT_TIMESTAMP,
PRIMARY KEY (memberid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ");
$installer->endSetup();
models file:
class Att_Membership_Model_Members extends Mage_Core_Model_Abstract{
public function _construct(){
$this->_init('membership/members');
} }
class Att_Membership_Model_Mysql4_Members extends Mage_Core_Model_Mysql4_Abstract{
public function _construct(){
$this->_init('membership/members','memberid');
} }