Home » XML » XML_Serializer » Bug #3762
not serialize null object properties
Details
| Request #3762 | not serialize null object properties |
|---|---|
| Submitted | 2005-03-10 13:26 UTC |
| From | mark at mitchenall dot com |
| Assigned | schst |
| Status | Closed |
| Package | XML_Serializer |
| PHP Version | 4.3.10 |
| OS | Any |
| 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'