]> git.andy128k.dev Git - ipf-legacy-orm.git/commitdiff
minor refactoring
authorAndrey Kutejko <andy128k@gmail.com>
Sat, 27 Jul 2013 06:47:38 +0000 (09:47 +0300)
committerAndrey Kutejko <andy128k@gmail.com>
Sat, 27 Jul 2013 06:47:38 +0000 (09:47 +0300)
ipf/orm/datadict.php
ipf/orm/query/condition.php

index 77bcdc60e5562d3614000824c98a36644185aff5..56a20985cdf051a00b8fa949b98eef7cb2127614 100644 (file)
@@ -36,15 +36,5 @@ class IPF_ORM_DataDict extends IPF_ORM_Connection_Module
 
         return $change;
     }
+}
 
-    public function parseBoolean($value)
-    {
-        // parse booleans
-        if ($value == 'true') {
-            $value = 1;
-        } elseif ($value == 'false') {
-            $value = 0;
-        }
-        return $value;
-    }
-}
\ No newline at end of file
index 5a93f51556ad5460f99b35619365aa265677d693..b18e9eb6a3f0959fd7975fd7890bd61e59f3a267 100644 (file)
@@ -43,13 +43,23 @@ abstract class IPF_ORM_Query_Condition extends IPF_ORM_Query_Part
         return '(' . $r . ')';
     }
 
+    private function parseBoolean($value)
+    {
+        // parse booleans
+        if ($value == 'true') {
+            $value = 1;
+        } elseif ($value == 'false') {
+            $value = 0;
+        }
+        return $value;
+    }
+
     public function parseLiteralValue($value)
     {
         // check that value isn't a string
         if (strpos($value, '\'') === false) {
             // parse booleans
-            $value = $this->query->getConnection()
-                     ->dataDict->parseBoolean($value);
+            $value = $this->parseBoolean($value);
 
             $a = explode('.', $value);
 
@@ -68,4 +78,4 @@ abstract class IPF_ORM_Query_Condition extends IPF_ORM_Query_Part
         }
         return $value;
     }
-}
\ No newline at end of file
+}