Skip to content

Instantly share code, notes, and snippets.

@xcommerce-gists
Last active January 3, 2016 22:39
Show Gist options
  • Save xcommerce-gists/8530149 to your computer and use it in GitHub Desktop.
Save xcommerce-gists/8530149 to your computer and use it in GitHub Desktop.
Sample Magento config.xml showing how to alias a database table
<?xml version="1.0"?>
<!--
/**
* Module configuration
*
* @author Magento
*/
-->
<config>
<modules>
<!-- omitted for brevity -->
</modules>
<global>
<models>
<!-- omitted for brevity -->
<news_resource>
<class>Magentostudy_News_Model_Resource</class>
<entities>
<news>
<table>magentostudy_news</table> <!-- name of the module's database table -->
</news>
</entities>
</news_resource>
</models>
<helpers>
<!-- omitted for brevity -->
</helpers>
<blocks>
<!-- omitted for brevity -->
</blocks>
<resources>
<magentostudy_news_setup> <!-- specifies nested directory in which to store DB scripts -->
<setup>
<module>Magentostudy_News</module>
<class>Mage_Core_Model_Resource_Setup</class> <!-- Magento core class -->
</setup>
</magentostudy_news_setup>
</resources>
<!-- omitted for brevity -->
</global>
</config>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment