I have an example of an object that is dependent on other objects, such as
$ ObjA = new Some_Class (); $ ObjB = new other_class (); $ ObjC = new_other_on (); $ ObjA- & gt; Property = new STD class; $ ObjB-> Key = $ objA; $ ObjB-> Arr = array (new__Object ()); $ ObjectC- & gt; Property = $ objb $ objectC-> Other = array (array ('k' = & gt; 'v')); How do I get a list of classes used in $ ObjectC ? In this special case:
array ('Some_Class', 'Other_Class', 'Other_Class', 'stdClass', 'other_object') I want to serial the object, but before unserializing I need to instantiate all the necessary classes.
How do you automatically get classes?
serialize is not shallow, it is deep. This means that if you call serialize ($ objectC); , you are not only receiving $ objectC, but also which contains an unserializable resource), consider implementing the interface, so that you are fine on programmed and unstructured tasks. -Well control that is not possible with the magic of the HOD. You can use the methods provided by the interface to back up the customized data structure, which will allow you to manually reconstruct the required object.
Comments
Post a Comment