Magento: can two modules extend the same core model?

Is it possible to create two modules which extend the same core model like Mage_Customer_Model_Customer?

What will I receive when I access the (overloaded) core model?

One thought on “Magento: can two modules extend the same core model?”

  1. You can extend the Model class across custom models:

    class Namespace_Module_Model_Customer1 extends Mage_Customer_Model_Customer

    defined in app/code/local/Namespace/Customer/Model/Customer1.php, and:

    class Namespace_Module_Model_Customer2 extends Mage_Customer_Model_Customer

    defined in app/code/local/Namespace/Customer/Model/Customer2.php.

    that should be fine – You’ll have to specify which model you want when you call it:

    Mage::getModel('namespace/customer1')->method()

    or

    Mage::getModel('namespace/customer2')->method()

    the core model will be unchanged:

    Mage::getModel('customer/customer')

Leave a Reply

Your email address will not be published. Required fields are marked *