RE: [PEAR] RFC: slight modification to the get*Value() methods (in PEAR::MDB)

From: Date: Sun, 29 Dec 2002 15:02:01 +0000
Subject: RE: [PEAR] RFC: slight modification to the get*Value() methods (in PEAR::MDB)
References: 1  Groups: php.pear.dev php.pear.general 
Request: Send a blank email to pear-dev+get-11921@lists.php.net to get a copy of this message
I keep forgetting what package I am talking about all too often .. Anyways I am talking about PEAR::MDB. Regards, Lukas PS: since the previous post is quite hard to link to a package I am including the entire original post underneath. > -----Original Message----- > From: Lukas Smith [mailto:smith@dybnet.de] > Sent: Sunday, December 29, 2002 3:59 PM > To: pear-dev@lists.php.net; pear-general@lists.php.net > Subject: [PEAR] RFC: slight modification to the get*Value() methods > > Hi, > > I am contemplating making a little modification to the get*Value() > methods, that convert values to be used within a query regarding NULL > values. > > Currently working with NULL values is a bit clumsy imho. > If you want a NULL value from getTimestampValue() for example you will > have to set the value passed to the method to 'Null'. Its even worse for > getTextValue where this is currently not even handled internally. You > will have to determine if to use getTextValue() or not yourself. This is > done because the string 'Null' passed to getTextValue() could very well > mean that you want the string 'Null' inserted into your DB. > > Therefore I am proposing the following change: > If you pass the PHP constant NULL to any of the get*Value() methods you > will get the string 'NULL' returned. > > Does this sounds like a more intuitive and consistent approach? > > Then we don’t need the old method used in all but getTextValue() of > passing the string 'Null', so I would like to drop it. This will of > course break BC (the Metabase wrapper will not be affected by this BC > break of course). > > Doing this BC break will not be a big deal to fix for me. I don’t know > how many people rely on the old behavior (I don’t even know how many > people actually use MDB and are not still evaluating ...). I would hate > to leave the old code in because it just adds another if statement to > such a frequently used method. Then again I don’t want to piss off my > existing user base ... > > Regards, > Lukas Smith > smith@dybnet.de > _______________________________ > DybNet Internet Solutions GbR > Reuchlinstr. 10-11 > Gebäude 4 1.OG Raum 6 (4.1.6) > 10553 Berlin > Germany > Tel. : +49 30 83 22 50 00 > Fax : +49 30 83 22 50 07 > www.dybnet.de info@dybnet.de > > > > -- > PEAR General Mailing List (http://pear.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.pear.dev (#11921) next »