From 677f3e8d8155f3bb85dffc257e03c498ba31982c Mon Sep 17 00:00:00 2001 From: Andrey Kutejko Date: Sat, 27 Jul 2013 09:47:38 +0300 Subject: [PATCH] minor refactoring --- ipf/orm/datadict.php | 12 +----------- ipf/orm/query/condition.php | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ipf/orm/datadict.php b/ipf/orm/datadict.php index 77bcdc6..56a2098 100644 --- a/ipf/orm/datadict.php +++ b/ipf/orm/datadict.php @@ -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 diff --git a/ipf/orm/query/condition.php b/ipf/orm/query/condition.php index 5a93f51..b18e9eb 100644 --- a/ipf/orm/query/condition.php +++ b/ipf/orm/query/condition.php @@ -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 +} -- 2.49.0