Let's say, for simplicity, this is how my page is set up:
class TFS extends PHP_db
{
public function execute() {
class Dostuff {
public static function doit() {
return "wee";
}
}
Now here I can use Dostuff:doit() successfully
And also $this->db->functionhere() which is from the PHP_db is also successful from here
}
}
I need to figure how to call $this->db->functionhere()
from within the doit()
function inside the Dostuff class..
I have already tried this in the Dostuff class:
protected $parent_object;
public function __construct( $object ) {
$this->parent_object = $object;
}
and this from the execute() function: $dostuffclass = new Dostuff($this);
But then when I try to use $parent_object->db->functionhere()
it doesn't work, telling me it's not an object.