Closed iqis closed 3 years ago
It's intentional that the instances don't contain a reference to the generator object; this makes it possible for them to be serialized (saved) without having to save the generator object as well. You could simply add a class
field and populate it either in the initialize()
method, or with $set()
, as in:
MyClass$set("public", "class", MyClass)
If an instance could contain a reference to its class(generator), it would allow methods or outside program to create new objects in the same class.
It could be included as a field
class
, or more discreetly, as an attribute of the object.