It is required to overwrite customer_resource class. I added required config.xml options for resource rewriting, but when overwritten class method calls parent class method from itself, it actually called the parent method from which I extend to, nor the parent of Mage_Customer_Model_Resource_Customer:
class My_Plugin_Model_Resource_Customer extends Mage_Customer_Model_Resource_Customer
{
protected function _beforeSave(Varien_Object $customer){
parent::_beforeSave($customer);
...
}
}
So, how to call parent method correctly in this case ? some kind of double downcasting is possible in php ?
The easiest solution, in particular this case, was to call:
Mage_Eav_Model_Entity_Abstract::_beforeSave($customer);
as the required parent of Mage_Customer_Model_Resource_Customer is Mage_Eav_Model_Entity_Abstract it will call the grandparent.
also, there is method with ReflectionMethod->invoke()
more info here: How to call grandparent method without getting E_STRICT error?