Re: DB_DataObject: transform columns

From: Date: Tue, 01 Feb 2005 04:17:39 +0000
Subject: Re: DB_DataObject: transform columns
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-17311@lists.php.net to get a copy of this message
Nope - it goes against the grain of path of least supprise.. (it's just delivering what the pgsql_* functions return) - although I think pecl/DBDO will do this, as the backend driver has a full on type library. Regards Alan subs@snackfood.org wrote:
Hi, DB_DataObject: is there a way to transform columns automatically according to their type? For example, I'm using Postgres and I'd like to translate all booleans from the native representations 't' and 'f', to PHP true and false transparently (and vice-versa) without having to provide my own set* and get* methods for specific fields in each table class (not even sure if that would work). example usage would be: $dataobject->my_bool_field = true; // sets as 't' internally $bool = $dataobject->my_bool_field; // $bool gets PHP true Am I missing an obvious solution? Thanks, Ben


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