1
0
mirror of synced 2025-01-18 22:41:43 +03:00
This commit is contained in:
zYne 2007-04-17 17:41:51 +00:00
parent 10f96e01e3
commit 9e35c9029b
2 changed files with 18 additions and 7 deletions

View File

@ -219,14 +219,18 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
* @param array $item
* @return void
*/
public function convertBooleans(array $items)
public function convertBooleans($item)
{
foreach ($items as $k => $item) {
if (is_bool($item)) {
$items[$k] = (int) $item;
if (is_array($item)) {
foreach ($item as $k => $value) {
if (is_bool($item)) {
$item[$k] = (int) $value;
}
}
} else {
$item = (int) $item;
}
return $items;
return $item;
}
/**
* Quote a string so it can be safely used as a table or column name

View File

@ -99,9 +99,16 @@ class Doctrine_Connection_Pgsql extends Doctrine_Connection_Common
* @param array $item
* @return void
*/
public function convertBooleans(array $items)
public function convertBooleans($item)
{
return $items;
if (is_array($item)) {
foreach ($item as $key => $value) {
$item[$key] = ($value) ? 'true' : 'false';
}
} else {
$item = ($item) ? 'true' : 'false';
}
return $item;
}
/**
* Changes a query string for various DBMS specific reasons