I have to override customer ResourceModel's customer.php
file in my custom module.
I have tried but its not working.so what is correct way to override Model? I follow below steps to override Model.
I have my own module called Namespace_Module
with a di.xml
file,
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
<preference for="Magento\Customer\Model\ResourceModel\Customer" type="Namespace\Modulename\Model\ResourceModel\Customer" />
</config>
Then I have created php file, Namespace\Modulename\Model\ResourceModel\Customer.php
and try to override core file.but its not working for me.
So please anyone help me to solve my problem.