Is this possible?
Let’s say there are two objects of the same type:
$object1->object2->property = 'xxxx';
now this is done trough __set().
At this point I’m within object2’s scope (which is a property of object1). How can I access object1 from that __set function?
You can’t.
object1isn’t the parent, it’s the container.If you want access to an
object1function fromobject2,you must have a reference to
object1.Use this kind of pattern :
Is that what you’re looking for ?