Fixing return value of DboSource::boolean()

This commit is contained in:
José Lorenzo Rodríguez 2010-10-17 23:39:53 -04:30
parent d9c9a32ff3
commit 16463229e5

View file

@ -2612,7 +2612,7 @@ class DboSource extends DataSource {
* Translates between PHP boolean values and Database (faked) boolean values * Translates between PHP boolean values and Database (faked) boolean values
* *
* @param mixed $data Value to be translated * @param mixed $data Value to be translated
* @return mixed Converted boolean value * @return int Converted boolean value
*/ */
public function boolean($data) { public function boolean($data) {
if ($data === true || $data === false) { if ($data === true || $data === false) {
@ -2621,7 +2621,7 @@ class DboSource extends DataSource {
} }
return 0; return 0;
} else { } else {
return !empty($data); return (int) !empty($data);
} }
} }