PHRETS
PHRETS copied to clipboard
Curious why all values are coerced to strings?
Any particular reason why the library is coercing all values to strings? I know that doing so ensures that no data is lost, but we also lose some valuable metadata about the original format of the value. Knowing that it was an integer without having to test for that can be useful, for example.
Any suggestions on overriding this behaviour? Is it recommended to sub-class the Results or Record classes to override this behaviour?
I figured the library would format according to the metadata, if available, but I'm not seeing that happen anywhere.
Field types are available through Metadata, you can have a table for the fields metadata (name, lookup values, type, searchable, etc) and use that for comparison.
The underlying delivery format of RETS gives everything as strings. Each record is wrapped in an XML tag but the record content itself is a delimited format. With experience looking at various servers, there are enough of them that don't provide values matching the declared metadata type that doing the extra work could actually eliminate some data you might otherwise be able to salvage.