Re: DB_DataObject - sugestion new feature

From: Date: Thu, 26 Feb 2004 02:27:37 +0000
Subject: Re: DB_DataObject - sugestion new feature
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-25877@lists.php.net to get a copy of this message
I think it's been suggested before. - I'm not keen to make the API any fatter than necessary.. - in this case $db = DB_DataObject:factory('sometable'); $db->.... do stuff... $db = DB_DataObject:factory('sometable'); $db->.... do stuff... works perfectly well, and is clearer to spot that $db has been totally cleaned (rather than below the reset method call is slightly easier to miss when you are reading the code...) Regards Alan Marcos Neves wrote:
what about a method that reset the DataObject? like this: $db = factory.... do something.... $db->reset(); do other things... where reset() is a method that back $db to his initial state doing something like this: function reset(){
    $this->selectAdd();
    $this->selectAdd("*");
    $this->whereAdd();
    $this->orderBy();
    $this->limit();
    // and clear internal data
    $this->id = null;
    $this->name = null;
}
-- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.com

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