From 59b18ff0ba446860cdb13e16db7ceb8f8bbe99f7 Mon Sep 17 00:00:00 2001 From: xue <> Date: Sun, 26 Nov 2006 14:54:40 +0000 Subject: Added TDbConnection.setPersistent. --- framework/Data/TDbConnection.php | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'framework') diff --git a/framework/Data/TDbConnection.php b/framework/Data/TDbConnection.php index acb1aec1..9652258d 100644 --- a/framework/Data/TDbConnection.php +++ b/framework/Data/TDbConnection.php @@ -362,6 +362,24 @@ class TDbConnection extends TComponent $this->setAttribute(PDO::ATTR_AUTOCOMMIT,TPropertyValue::ensureBoolean($value)); } + /** + * @return boolean whether the connection is persistent or not + * Some DBMS (such as sqlite) may not support this feature. + */ + public function getPersistent() + { + return $this->getAttribute(PDO::ATTR_PERSISTENT); + } + + /** + * @param boolean whether the connection is persistent or not + * Some DBMS (such as sqlite) may not support this feature. + */ + public function setPersistent($value) + { + return $this->setAttribute(PDO::ATTR_PERSISTENT,TPropertyValue::ensureBoolean($value)); + } + /** * @return string name of the DB driver */ @@ -387,15 +405,6 @@ class TDbConnection extends TComponent return $this->getAttribute(PDO::ATTR_CONNECTION_STATUS); } - /** - * @return boolean whether the connection is persistent or not - * Some DBMS (such as sqlite) may not support this feature. - */ - public function getPersistent() - { - return $this->getAttribute(PDO::ATTR_PERSISTENT); - } - /** * @return boolean whether the connection performs data prefetching */ -- cgit v1.2.3