Skip to main content

How do I find out the proper table name?




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

Popular posts from this blog

HTML Emailing in ZF2

<?php namespace Application\Model; use Zend\Mail\Message; use Zend\Mime\Message as MimeMessage; use Zend\Mime\Part as MimePart; use Zend\Mail\Transport\Sendmail as SendmailTransport; use Zend\Mail\Transport\Smtp as SmtpTransport; use Zend\Mail\Transport\SmtpOptions; use Zend\View\Renderer\PhpRenderer; use Zend\View\Resolver\TemplatePathStack; use Zend\View\Model\ViewModel; use Zend\View\Model\ModelInterface; class ApiEmail extends ApiInterface {    protected $From = "XXXXX@gmail.com";    protected $FromName = "XXXX";    protected $To = "" ;    protected $Subject = "" ;    protected $Body = "" ;    protected $Cc = "XXXXXX@gmail.com";    protected $Bcc = "XXXXX@gmail.com" ;    protected $ReplyTo = "XXXX@gmail.com" ;    protected $Sender = "" ;    protected $Encoding = "UTF-8" ;    protected $MESSAGE ; // getter setter ...

How to setup django | django installation ubuntu

Introduction to Django 1.     High level web framework 1.     Basic modules, classes, and tools to quickly develop and deploy web apps 2.     Contains an ORM (Object-Relational Mapper) that allows for the use of standard Python language syntax when interfacing with a back-end database. 1.     Developer need not learn SQL, DDL, etc! 3.     Provides a template framework that allows HTML, XML, and other “documents” to be converted into “templates”, which can then be converted to “output” via a wide range of substitution techniques. 4.     Elegant URL support (fancy, beautiful URL's, no “?blah=blah”, etc.) 5.     Multi-lingual 2.     Fast and easy to use, robust, flexible, and lots of contributed components available! 1.     Built in administrative interface to manage data models. 2.     Built-in authentication/ac...

Using FileZilla and SFTP with OpenShift