Re: CLASS/Object lifetime

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jochem Maas wrote:
roger helgesen wrote:
 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.

I attach the code.
CLASS1 = sammendragHTML (child of sammendrag)
CLASS2 = gruppe

There is quite a lot of "rubbish" in the code !

tnx!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux