1
0
mirror of synced 2025-01-20 15:31:40 +03:00

boolean value parsing added

This commit is contained in:
zYne 2007-02-15 11:36:43 +00:00
parent f4553f800f
commit e80b339d7f
2 changed files with 30 additions and 0 deletions

View File

@ -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;
}
}

View File

@ -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;
}
}