Re: [fw-general] Zend Session and objects

2008-11-03 Thread spaceage
That makes perfect sense (each object calling its own serialize method(s))... I learned that omitting the __sleep method in the object will result in all properties getting serialized (as one would expect from $_SESSION functionality). My issue seems to be that I had a Zend_Db_Select object as a

Re: [fw-general] Zend Session and objects

2008-11-03 Thread Matthew Ratzloff
a) A->B->C: A has object B has object C. A's serialization method should call serialize() on B. B's serialization method should call serialize() on C. The only automatic aspect is that serialize() called on an object calls its __sleep() method. b) Not sure. I'll let Ralph or someone else answer

Re: [fw-general] Zend Session and objects

2008-11-03 Thread spaceage
Matt--thanks for your reply. So, I think I'm clear about the need to implement the __sleep() method in the object to perform serialization--return an array with the list of properties you want serialized. I have a couple more questions on this: a) if I have properties in my class which are them

Re: [fw-general] Zend Session and objects

2008-11-03 Thread Matthew Ratzloff
Of course; think about how sessions work and their relationship with in-memory objects. You must serialize all the information necessary to recreate that object in its current state, then handle its corresponding deserialization. http://www.php.net/~helly/php/ext/spl/interfaceSerializable.html htt

[fw-general] Zend Session and objects

2008-11-03 Thread spaceage
I'm struggling with object persistence in sessions...sorry if this is a newbie question, but couldn't find answers in the archives... Basically, I'm loading my namespace session vars; then in my action, I check if an object exists in the session vars, and if so assign a local reference to it. If