There is an object of a certain class "A", you need to display its property and call a method.
php gives the error that there is no access to these methods. they are pretected.
how to get access?
- More details:
There is an event
function before($obj) { }
the $obj
parameter is an object of the Events
class that has a result
(array) field - protected
.
need to access it in the event. I'm trying to inherit:
class myClass extends Events { public function A() { print_r($this->result); } } $q = new myClass; $q->A();
Naturally displays an empty result, since I refer directly to the class property not to the property of the object. How to address the object?
Events
class and explained how and wherebefore
- Alexey Shimansky