I have a main class e.g.
class MY_API {
function __construct($db) {
$this->something = new MY_SOMETHING($db);
$this->anotherthing = new MY_ANOTHERTHING($db);
}
}
SO I can access this with
$this->something->somefunction();
But I am not sure how I could access:
$this->anotherthing->anotherfunction();
From within:
$this->something->somefunction();
I imagine I would need something like:
$this->parent->anotherthing->anotherfunction();
Is this possible at all, or do I need to change the way I am building the classes?
Ideally I just want these functions to sit in a different file rather than having one very large file and have each function in each file accessible to each other