Note that there are some explanatory texts on larger screens.

plurals
  1. POmagento: create your own collection
    primarykey
    data
    text
    <p>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.</p> <p>my config file chunk</p> <pre><code>&lt;models&gt; &lt;exporter&gt; &lt;class&gt;World_Exporter_Model&lt;/class&gt; &lt;!-- need to create our own resource, cant just use core_mysql4 --&gt; &lt;resourceModel&gt;exporter_mysql4&lt;/resourceModel&gt; &lt;/exporter&gt; &lt;exporter_mysql4&gt; &lt;class&gt;World_Exporter_Model_Mysql4&lt;/class&gt; &lt;entities&gt; &lt;exporter&gt; &lt;table&gt;profiles&lt;/table&gt; &lt;/exporter&gt; &lt;/entities&gt; &lt;/exporter_mysql4&gt; &lt;/models&gt; </code></pre> <p>My model</p> <pre><code>class World_Exporter_Model_Mysql4_Profiles extends Mage_Core_Model_Mysql4_Abstract { public function _construct() { $this-&gt;_init('exporter/profiles', 'profile_id'); } } </code></pre> <p>And my collection</p> <pre><code> class World_Exporter_Model_Mysql4_Profiles_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract { public function _construct(){ parent::_construct(); $this-&gt;_init('exporter/profiles'); } } </code></pre> <p>If you want to help me. I am great full. </p> <p>(Added After getting Answer)....</p> <pre><code> $model = Mage::getResourceModel('exporter/profiles'); // $model = Mage::getModel('exporter/profiles'); $collection = $model-&gt;getCollection(); </code></pre> <p>Fatal error: Call to undefined method World_Exporter_Model_Mysql4_Profiles::getCollection()</p> <pre><code> // $model = Mage::getResourceModel('exporter/profiles'); $model = Mage::getModel('exporter/profiles'); $collection = $model-&gt;getCollection(); </code></pre> <p>a:5:{i:0;s:47:Can't retrieve entity config: exporter/profiles";i:1;s:2542:</p> <p>#0 \app\code\core\Mage\Core\Model\Resource.php(272): Mage::throwException('Can't retrieve ...')</p> <p>#1 \app\code\core\Mage\Core\Model\Resource\Db\Abstract.php(284): Mage_Core_Model_Resource->getTableName('exporter/profil...')</p> <p>#2 \app\code\core\Mage\Core\Model\Resource\Db\Abstract.php(247): Mage_Core_Model_Resource_Db_Abstract->getTable('profiles')</p> <h1>But i do have the table "profiles" in db</h1> <p>I will appreciate your help…</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload