Skip to content

Commit

Permalink
Fixing return value of DboSource::boolean()
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Oct 18, 2010
1 parent d9c9a32 commit 1646322
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cake/libs/model/datasources/dbo_source.php
Expand Up @@ -2612,7 +2612,7 @@ public function length($real) {
* Translates between PHP boolean values and Database (faked) boolean values
*
* @param mixed $data Value to be translated
* @return mixed Converted boolean value
* @return int Converted boolean value
*/
public function boolean($data) {
if ($data === true || $data === false) {
Expand All @@ -2621,7 +2621,7 @@ public function boolean($data) {
}
return 0;
} else {
return !empty($data);
return (int) !empty($data);
}
}

Expand Down

0 comments on commit 1646322

Please sign in to comment.