RFC: slight modification to the get*Value() methods

From: Date: Sun, 29 Dec 2002 14:59:12 +0000
Subject: RFC: slight modification to the get*Value() methods
Groups: php.pear.dev php.pear.general 
Request: Send a blank email to pear-general+get-3105@lists.php.net to get a copy of this message
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

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