PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » XML » XML_Serializer » Bug #3762

not serialize null object properties

Details

Request #3762not serialize null object properties
Submitted2005-03-10 13:26 UTC
Frommark at mitchenall dot com
Assignedschst
StatusClosed
PackageXML_Serializer
PHP Version4.3.10
OSAny
Roadmaps(Not assigned)

Comments

[2005-03-10 13:26 UTC] mark at mitchenall dot com

Description:
------------
It would be useful to have an option, e.g. ignoreNullProperties, which doesn't serialize an object property if it is NULL. Either that, or perhaps allow developers to define their own serialize methods in classes where elements need special handling. Maybe in a similar way to DB_DataObject and the 'validate' methods.

Adding an ignoreNullProperties option I can add myself, if that's useful, and send the patch. The second method using custom serialize methods I haven't figured out the nicest way of implementing yet, so I wont comment too much on that.

[2005-03-10 18:47 UTC] mark at mitchenall dot com

not sure what happened with the subject of this feature request, but it should be 'not serialize null object properties'