]> git.andy128k.dev Git - ipf-legacy-orm.git/commitdiff
cleanup
authorAndrey Kutejko <andy128k@gmail.com>
Sat, 8 Jun 2013 19:20:19 +0000 (22:20 +0300)
committerAndrey Kutejko <andy128k@gmail.com>
Sat, 8 Jun 2013 19:20:19 +0000 (22:20 +0300)
ipf/orm/configurable.php
ipf/orm/connection.php
ipf/orm/formatter.php
ipf/orm/manager.php

index 0c6661461561a74551bc8602092dd5311457e4e7..2a2e7593c89fe7e15117c2071451e45917c28f0a 100644 (file)
@@ -108,13 +108,13 @@ abstract class IPF_ORM_Configurable extends IPF_ORM_Locator_Injectable
 
     public function getParams($namespace = null)
     {
-       if ($namespace == null) {
-           $namespace = $this->getAttribute(IPF_ORM::ATTR_DEFAULT_PARAM_NAMESPACE);
-       }
-       
-       if ( ! isset($this->_params[$namespace])) {
-           return null;
-       }
+        if ($namespace == null) {
+            $namespace = $this->getAttribute(IPF_ORM::ATTR_DEFAULT_PARAM_NAMESPACE);
+        }
+
+        if (!isset($this->_params[$namespace])) {
+            return null;
+        }
 
         return $this->_params[$namespace];
     }
@@ -126,22 +126,22 @@ abstract class IPF_ORM_Configurable extends IPF_ORM_Locator_Injectable
 
     public function setParam($name, $value, $namespace = null) 
     {
-       if ($namespace == null) {
-           $namespace = $this->getAttribute(IPF_ORM::ATTR_DEFAULT_PARAM_NAMESPACE);
-       }
-       
-       $this->_params[$namespace][$name] = $value;
-       
-       return $this;
+        if ($namespace == null) {
+            $namespace = $this->getAttribute(IPF_ORM::ATTR_DEFAULT_PARAM_NAMESPACE);
+        }
+
+        $this->_params[$namespace][$name] = $value;
+
+        return $this;
     }
     
     public function getParam($name, $namespace = null) 
     {
-       if ($namespace == null) {
-           $namespace = $this->getAttribute(IPF_ORM::ATTR_DEFAULT_PARAM_NAMESPACE);
-       }
-       
-        if ( ! isset($this->_params[$name])) {
+        if ($namespace == null) {
+            $namespace = $this->getAttribute(IPF_ORM::ATTR_DEFAULT_PARAM_NAMESPACE);
+        }
+
+        if (!isset($this->_params[$name])) {
             if (isset($this->parent)) {
                 return $this->parent->getParam($name, $namespace);
             }
index 7e1cfd822e020b0aaea367e286080360626338a4..9a4b4f143486e686ccd301deeefd35a397976a42 100644 (file)
@@ -200,15 +200,13 @@ abstract class IPF_ORM_Connection extends IPF_ORM_Configurable implements Counta
     public function getDbh()
     {
         $this->connect();
-        
         return $this->dbh;
     }
 
     public function connect()
     {
-        if ($this->isConnected) {
+        if ($this->isConnected)
             return false;
-        }
 
         $event = new IPF_ORM_Event($this, IPF_ORM_Event::CONN_CONNECT);
 
index c4bf9c7bf09c754c27741da6bbf625315c6513a4..078f655bae883706b749ebb492a058f61d2066a1 100644 (file)
@@ -85,8 +85,6 @@ class IPF_ORM_Formatter extends IPF_ORM_Connection_Module
         case 'gzip':
         case 'blob':
         case 'clob':
-            $this->conn->connect();
-
             return $this->conn->getDbh()->quote($input);
         }
     }
@@ -130,3 +128,4 @@ class IPF_ORM_Formatter extends IPF_ORM_Connection_Module
                 $table);
     }
 }
+
index f78e88f8d7ee1fd274cd252de7f8f53c2a761d93..b76b5b0857c7e3830ea05724a33855c372c8e1b6 100644 (file)
@@ -17,7 +17,7 @@ class IPF_ORM_Manager extends IPF_ORM_Configurable implements Countable, Iterato
     public function setDefaultAttributes()
     {
         static $init = false;
-        if ( ! $init) {
+        if (!$init) {
             $init = true;
             $attributes = array(
                         IPF_ORM::ATTR_CACHE                    => null,
@@ -422,3 +422,4 @@ class IPF_ORM_Manager extends IPF_ORM_Configurable implements Countable, Iterato
         return implode("\n",$r);
     }
 }
+