My di.xml file
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\Customer\Model\ResourceModel\AddressRepository" type="Maha\CreateLastname\Model\ResourceModel\AddressRepository" />
</config>
AddressRepository.php file(override model file)
<?php
namespace Maha\CreateLastname\Model\ResourceModel;
class AddressRepository extends \Magento\Customer\Model\ResourceModel\AddressRepository
{
private function _validate(CustomerAddressModel $customerAddressModel) {
echo "Model Rewrite Working";
die();
}
}
I want override the private function in this code. What can I do? I want to change anything in my code