]> git.andy128k.dev Git - ipf-legacy-orm.git/commitdiff
allow persistant connection to DB
authorAndrey Kutejko <andy128k@gmail.com>
Mon, 3 Jun 2013 19:48:15 +0000 (22:48 +0300)
committerAndrey Kutejko <andy128k@gmail.com>
Mon, 3 Jun 2013 19:48:15 +0000 (22:48 +0300)
ipf/orm/manager.php

index 1c1b78a344675e05d4971b8806ff1497f6b2cce5..ee2f721d229832bc6e955e21e35d4492279b75af 100644 (file)
@@ -84,7 +84,7 @@ class IPF_ORM_Manager extends IPF_ORM_Configurable implements Countable, Iterato
         }
     }
 
-    public function openConnection($adapter, $name = null, $setCurrent = true)
+    public function openConnection($adapter, $name = null, $setCurrent = true, $persistent = false)
     {
         if (is_object($adapter)) {
             if ( ! ($adapter instanceof PDO) && ! in_array('IPF_ORM_Adapter_Interface', class_implements($adapter))) {
@@ -156,6 +156,8 @@ class IPF_ORM_Manager extends IPF_ORM_Configurable implements Countable, Iterato
 
         $className = $drivers[$driverName];
         $conn = new $className($this, $adapter);
+        if ($persistent)
+            $conn->setOption(IPF_ORM::ATTR_PERSISTENT, true);
         $conn->setName($name);
         $conn->setCharset('utf8');