diff --git a/lib/Doctrine/DataDict.php b/lib/Doctrine/DataDict.php index e52b61fb6..0875db928 100644 --- a/lib/Doctrine/DataDict.php +++ b/lib/Doctrine/DataDict.php @@ -73,4 +73,22 @@ class Doctrine_DataDict extends Doctrine_Connection_Module return $change; } + /** + * parseBoolean + * parses a literal boolean value and returns + * proper sql equivalent + * + * @param string $value boolean value to be parsed + * @return string parsed boolean value + */ + public function parseBoolean($value) + { + // parse booleans + if ($value == 'true') { + $value = 1; + } elseif ($value == 'false') { + $value = 0; + } + return $value; + } } diff --git a/lib/Doctrine/DataDict/Pgsql.php b/lib/Doctrine/DataDict/Pgsql.php index da89dc0e8..be220225b 100644 --- a/lib/Doctrine/DataDict/Pgsql.php +++ b/lib/Doctrine/DataDict/Pgsql.php @@ -602,4 +602,16 @@ class Doctrine_DataDict_Pgsql extends Doctrine_DataDict $name = $this->conn->quoteIdentifier($name, true); return $name . ' ' . $this->getNativeDeclaration($field) . $default . $notnull; } + /** + * parseBoolean + * parses a literal boolean value and returns + * proper sql equivalent + * + * @param string $value boolean value to be parsed + * @return string parsed boolean value + */ + public function parseBoolean($value) + { + return $value; + } }