Magento: adding a custom object

Im creating an extension that adds extra functionality to the review model. I created a database table and I need to add it as an object in the etc / config.xml file. In the config.xml overview, it creates objects with the following:

<models>
        <review>
            <class>Mage_Review_Model</class>
            <resourceModel>review_mysql4</resourceModel>
        </review>
        <review_mysql4>
            <class>Mage_Review_Model_Mysql4</class>
            <entities>
                <review>
                    <table>review</table>
                </review>
                <review_detail>
                    <table>review_detail</table>
                </review_detail>
                <review_status>
                    <table>review_status</table>
                </review_status>
                <review_entity>
                    <table>review_entity</table>
                </review_entity>
                <review_aggregate>
                    <table>review_entity_summary</table>
                </review_aggregate>
                <review_store>
                    <table>review_store</table>
                </review_store>
                <review_parent>
                    <table>review_parent</table>
                </review_parent>
            </entities>
        </review_mysql4>
    </models>

And this is what I still (excluding the essence)

<config>
<modules>
    <XXX_CustomerReview>
        <version>0.1</version>
    </XXX_CustomerReview>
</modules>
<global>
    <models>
        <review_mysql4>
            <rewrite>
                <review>XXX_CustomerReview_Model_Mysql4_Review</review>
            </rewrite>
        </review_mysql4>
    </models>
</global>

I can’t understand how I do this, any help would be appreciated.

0
source share
1 answer

There is quite a bit of work, and you can watch this video, especially from half way forward, where Ivan shows how he created the data definitions and configurations for this.

http://vimeo.com/35937480

This should give you a better understanding of this.

Further explanation can be found here:

http://www.magentocommerce.com/knowledge-base/entry/magento-for-dev-part-7-advanced-orm-entity-attribute-value

0

All Articles