Re: DB_DataObjects save method

From: Date: Fri, 29 Oct 2004 00:17:54 +0000
Subject: Re: DB_DataObjects save method
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-34139@lists.php.net to get a copy of this message
technically it should be called replaceInto(), as that's the only SQL (albeit non standard) command that emulates that behavior.. - as the API follows SQL as close as possible.. Feel free to send over a patch. Regards Alan Andrew Nagy wrote:
Hello All! I know this is a little late in the game since DB_DataObjects is a mature package and this suggestion is not thought out in depth, but what about a method called "save"? The method would check to see if the primary key is set and if so call update otherwise call insert. I find myself writing this simple if statement everywhere in my "controller" classes and for some reason (after 2 years of DO use!) thought about making a method that did such. Has this topic ever been debated? I haven't researched other DO abstraction models (I remember an ex co-worker of mine had written a DO class for MONO and was thinking about this). Just a quick thought Andrew


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