[eluser]North2Alaska[/eluser]
[quote author="WanWizard" date="1332578713"]
It should not be a problem to overload methods that are defined "protected". What is the problem you have?[/quote]
In my Basemodel, I overload the Save function, for example. I need to use the timestamp function to set the updated_field when the created_field is set. So I want to call _get_generated_timestamp(), but it is a private function.
Code:
public function save($object = '', $related_field = '')
{
$timestamp = parent::_get_generated_timestamp();
When I do this I get an error: PHP Fatal error: Call to private method DataMapper::_get_generated_timestamp()
So, what I ended up doing is just copying the function to Base class and changed the call to
Code:
$timestamp = $this->_get_generated_timestamp()
Obviously, I'm doing something wrong. I'm reading PHP docs to try and understand overloading, but the answer is still eluding me.