Re: PEAR::DB getting automcommit status
| From: | Lukas Smith | Date: | Mon, 26 Sep 2005 09:52:59 +0000 |
| Subject: | Re: PEAR::DB getting automcommit status | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-39935@lists.php.net to get a copy of this message | ||
Jeroen Houben wrote:
Firman Wandayandi wrote:It would be a good idea to open a feature request on this one. regards, LukasOn 9/26/05, Jeroen Houben <jeroen@terena.nl> wrote:This looks a bit weird IMHO, you just get back whatever you pass in. I think what I need is a simple getter for $autocommit: function getAutoCommit() { return $this->autocommit; }Hi, I think it useful to be able to get the current autocommit status of a PEAR::DB connection object. I can only use $db->autoCommit(false), but there is no method to get the autocommit property (marked as private) or to find out if a transaction was started. Any particular reason for this?/*** enable automatic Commit * * @param boolean $onoff * @return mixed DB_Error * * @access public */function autoCommit($onoff=false) {return $this->raiseError(DB_ERROR_NOT_CAPABLE);} see autoCommit() is a public. Otherwise you right the autoCommit() returns DB_OK. Do you think like this: function autoCommit($onoff = null) {if ($onoff !== null) { $this->autocommit = $onoff; } return $this->autocommit;}