The core resource model has a method to get you any table name for any model in
the system. Table names do not have to follow the name of the model, an end-user
can change the table names by changing an XML setting. Also, any installation can
have an arbitrary prefix for any table. Therefore, it is best to use the getTable method
of the core resource
$r = Mage::getResourceSingleton(’core/resource’)->getConnection(’core_read’)
$tableName = $r->getTable(’catalog/product’);
$tableName === ’catalog_product_entity
This happens because we have the following XML configuration in the catalog module’s
config file.
<global>
<models>
<catalog>
<class>Mage_Catalog_Model</class>
<resourceModel>catalog_resource_eav_mysql4</resourceModel>
</catalog>
<catalog_resource_eav_mysql4>
<entities>
<product>
<table>catalog_product_entity</table>
</product>
Table Name : catalog_product_entity
Comments
Post a Comment