boolean value parsing added
This commit is contained in:
parent
f4553f800f
commit
e80b339d7f
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user