I would like to create a custom module. I have taken the following setps my code are below.
app\code\local\Amzad\OrderComment\etc\config.xml
<models>
<ordercomment>
<class>Amzad_OrderComment_Model</class>
</ordercomment>
<ordercomment_resource>
<class>Amzad_OrderComment_Model_Resource</class>
<entities>
<config>
<table>ordercomment_config</table>
</config>
</entities>
</ordercomment_resource>
</models>
app\code\local\Amzad\OrderComment\Model\Resource\Config\Collection.php
class Amzad_OrderComment_Model_Resource_Config_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract {
protected function _construct()
{
$this->_init('ordercomment/config');
}
}
app\code\local\Amzad\OrderComment\Model\Resource\Config.php
class Amzad_OrderComment_Model_Resource_Config extends Mage_Core_Model_Resource_Db_Abstract
{
protected function _construct()
{
$this->_init('ordercomment/config', 'id');
}
}
app\code\local\Amzad\OrderComment\Model\Config.php
class Amzad_OrderComment_Model_Config extends Mage_Core_Model_Abstract
{
protected function _construct()
{
$this->_init('ordercomment/config');
}
}
Following 2 lines does not give me any output.
$collection = Mage::getModel('ordercomment/config')->getCollection();
echo "\n" . (string)$collection->getSelect()->limit(1);
php_error.log
PHP Fatal error: Call to a member function getSelect() on a non-object in
Could someone help me resolve this issue.