I'd like to understand better how calls to functions work in OOP. I have the following sample:
class SomeClass {
function __construct(){
//run function do()
//run function include()
//run function run()
}
public function do($foo){
//do some stuff
}
public function include(){
require_once( CONSTANT . 'required.php' );
}
public function run(){
required_func();
}
}
$load_class = new SomeClass();
in required.php:
function required_func(){
$customerInfo = "info";
$customer = $this -> do($customerInfo); //--> This isn't right
return $customer;
}
What I'm trying to do is to have required_func() run the do() with the $customerInfo. So essentially: How to call a Class public function from another function included in the require_once file? Am I even remotely on track here?
Thanks for your help