Welcome Guest, Not a member yet? Register   Sign In
Best way to serialize an object
#6

[eluser]Seppo[/eluser]
Have you think about using __sleep?
If you want to store all data but parent's var you can use some reflection and array functions, something like this:
Code:
function __sleep()
    {
        return (array_keys(array_diff(get_class_vars(__CLASS__), get_class_vars(get_parent_class($this)))));
    }


Messages In This Thread
Best way to serialize an object - by El Forum - 06-25-2008, 10:05 AM
Best way to serialize an object - by El Forum - 06-25-2008, 10:40 AM
Best way to serialize an object - by El Forum - 06-25-2008, 12:28 PM
Best way to serialize an object - by El Forum - 06-26-2008, 11:09 AM
Best way to serialize an object - by El Forum - 07-07-2008, 11:47 AM
Best way to serialize an object - by El Forum - 07-07-2008, 04:29 PM



Theme © iAndrew 2016 - Forum software by © MyBB