News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

DevShed:
Using the Sleep and Wakeup Functions to Serialize Objects in PHP (Part 2)
June 13, 2006 @ 08:11:34

DevShed continues their "serializing objects" series today with part two of the series, highlighting the use of the sleep and wakeup functionality of PHP to help with the serialization.

After refreshing the concepts that I deployed in the first part of this series, it's time to focus on the topics that I'll cover in this article, so you'll know what to expect before you continue reading. In this second part, I'll explain how to use objects in conjunction with the "__sleep()" and "__wakeup() magic functions respectively, in order to get the most out of them.

They start with a look at defining self-saving objects with their ObjectSaver class developed earlier. Building on that reminder, they integrate the "__sleep()" and "__wakeup()" functionality to handle calls immediately before and immediately after the handling of the object. They then use this new functionality to create persistent objects, capable of maintaining values across page requests.

0 comments voice your opinion now!
serialize object persist sleep wakeup save serialize object persist sleep wakeup save


blog comments powered by Disqus

Similar Posts

PHPEasy.co.uk: Object Orientation Basics part 4 Implementing CRUD methods

Community News: PHP 5.3beta1 Announced

Derick Rethans' Blog: PHP Vikinger 2008 Wrap-up

Felix Geisendorfer's Blog: Making error handling for Model::save more beautiful in CakePHP

BinaryTides.com: Javascript style object literals in PHP


Community Events

Don't see your event here?
Let us know!


framework interview release api introduction opinion development series language psr7 extension conference laravel5 library unittest community laravel video voicesoftheelephpant podcast

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework