DB_DataObject and XML_Serializer Private Variables

From: Date: Mon, 11 Jul 2005 01:40:53 +0000
Subject: DB_DataObject and XML_Serializer Private Variables
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-19935@lists.php.net to get a copy of this message
I have a data object and I want to serialize this object. When I preform the serialization I am getting a bunch of data pre-pended that I do not want. This data is: <_DB_DataObject_version>1.7.13</_DB_DataObject_version> <__table>table</__table> <N>2</N> <_database_dsn/> <_database_dsn_md5>678920bcaf47327fb936d911d8f42e7cd</_database_dsn_md5> <_database>database</_database> <_DB_resultid>1</_DB_resultid> <_link_loaded/> <_join/> <_lastError/> All of these values are (should be) private. I am looking for a solution that is not an ugly hack to remove these items from the output. I am not really sure if there is a function for the DB_DataObject that would return a cloned instance of the data without the private variables. Or if there is a method in XML_Serializer that would allow me to exclude certain data values from the serialized output. I have looked into the code and I have not seen anything like what I am looking for, but I could have missed it. The solution that I have for this would be to post-process the information from the data-object before having it serialized, but this seems really ugly to me, and I feel that it should be something that would be handled in both of these packages. Any recommendations?

« previous php.pear.general (#19935) next »