Recently, I developed dehydrate() and hydrate() functions for transmitting PHP objects over the wire, and saving them in database records.
dehydrate()
hydrate()
I'll use them a lot in the Osm Admin project, I hope you'll find them useful, too.
Blog post