hope that everybody is doing well. I am new to magento. I am working on magento module. I want to use grid in Admin but i need to use collections. I have created a few collection and haven't got any success in accessing any of them successfully. I want to know where i am wrong. let me share my problem with you.
my config file chunk
<models>
<exporter>
<class>World_Exporter_Model</class>
<!--
need to create our own resource, cant just
use core_mysql4
-->
<resourceModel>exporter_mysql4</resourceModel>
</exporter>
<exporter_mysql4>
<class>World_Exporter_Model_Mysql4</class>
<entities>
<exporter>
<table>profiles</table>
</exporter>
</entities>
</exporter_mysql4>
</models>
My model
class World_Exporter_Model_Mysql4_Profiles extends Mage_Core_Model_Mysql4_Abstract
{
public function _construct()
{
$this->_init('exporter/profiles', 'profile_id');
}
}
And my collection
class World_Exporter_Model_Mysql4_Profiles_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
{
public function _construct(){
parent::_construct();
$this->_init('exporter/profiles');
}
}
If you want to help me. I am great full.
(Added After getting Answer)....
$model = Mage::getResourceModel('exporter/profiles');
// $model = Mage::getModel('exporter/profiles');
$collection = $model->getCollection();
Fatal error: Call to undefined method World_Exporter_Model_Mysql4_Profiles::getCollection()
// $model = Mage::getResourceModel('exporter/profiles');
$model = Mage::getModel('exporter/profiles');
$collection = $model->getCollection();
a:5:{i:0;s:47:Can't retrieve entity config: exporter/profiles";i:1;s:2542:
#0 \app\code\core\Mage\Core\Model\Resource.php(272): Mage::throwException('Can't retrieve ...')
#1 \app\code\core\Mage\Core\Model\Resource\Db\Abstract.php(284): Mage_Core_Model_Resource->getTableName('exporter/profil...')
#2 \app\code\core\Mage\Core\Model\Resource\Db\Abstract.php(247): Mage_Core_Model_Resource_Db_Abstract->getTable('profiles')
But i do have the table "profiles" in db
I will appreciate your help…