I apologize if this is duplicate Question. I have a protected function. For example.
protected function example(){
//some code
}
and i would like to access this function from outside the class. And i came up with the following.
public function returnMyFunction(){
return $this->example();
}
What i would like to know if this is a correct way to do this. Thank you!
P.S I forgot to mention that i came up with that because in zend framework 2 i cannot extend the class that this function is in since the class i am calling it from is extending another