DB_DataObjects save method

From: Date: Thu, 28 Oct 2004 20:47:37 +0000
Subject: DB_DataObjects save method
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-34134@lists.php.net to get a copy of this message
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 (#34134) next »