B.php:
class B extends A {
function foo() {
$this->get['id'];
}
}
C.php:
namespace NAME;
class C extends B {
function foo() {
$b = new \B();
$b->get['id'] = $params['userToken'];
}
}
The above works but how to I access $this instead of creating a new instance of B
?
If I try and access it like this:
namespace NAME;
class C extends B {
function foo() {
$this->get['id'] = $params['userToken'];
}
}
It returns the error: Using $this when not in object context
. $this is protected
but as it C is extending B it shouldn't cause an issue and if it does, shouldn't return that error.