Re: CLASS/Object lifetime
| From: | roger helgesen | Date: | Tue, 21 Feb 2006 17:51:43 +0000 |
| Subject: | Re: CLASS/Object lifetime | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-230816@lists.php.net to get a copy of this message | ||
Jochem Maas wrote:
roger helgesen wrote:I attach the code. CLASS1 = sammendragHTML (child of sammendrag) CLASS2 = gruppe There is quite a lot of "rubbish" in the code ! tnx!Hi! I'v got 2 classes. CLASS1 makes a array of instanses of class2. I need thees classes 2 live for the duration of the session so I serialize class1 to a _session var. I submit the form and the page is reloaded. I unserialize class1 back 2 same instanse var. class1 I works. The instanses of class2 almost work. I can read all data from the class/object, I can run functions off class2 BUT I can't change the data in objects og class2. Is this at all possible. ps.I do not serialize/unserialize object of CLASS2, these are instanses of CLASS1.know this: you must define the class of any object you serialize in the session array BEFORE you start the session. (unless you want lots of problems) ========================== now if you could post some code then we can figure out why your array of CLASS2 objects (inside your unserialized CLASS1 object) do not contain the data they should (namely the data you stuffed in them before serializing the CLASS1 ['parent'] object) deal?regard Roger Helgesen The thing is that the array of CLASS2 do contain the data, but I can't change them.