Skip to content

Commit

Permalink
Merge pull request doctrine#467 from docteurklein/fix-bool-type-binding
Browse files Browse the repository at this point in the history
add bool detection when inferring type
  • Loading branch information
guilhermeblanco committed Oct 22, 2012
2 parents a16a935 + 7f8af83 commit 38d8c7f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/Doctrine/ORM/Query/ParameterTypeInferer.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/**
* Provides an enclosed support for parameter infering.
*
*
*
* @link www.doctrine-project.org
* @since 2.0
* @author Benjamin Eberlei <[email protected]>
Expand All @@ -50,6 +50,10 @@ public static function inferType($value)
return Type::INTEGER;
}

if (is_bool($value)) {
return Type::BOOLEAN;
}

if ($value instanceof \DateTime) {
return Type::DATETIME;
}
Expand All @@ -62,4 +66,4 @@ public static function inferType($value)

return \PDO::PARAM_STR;
}
}
}

0 comments on commit 38d8c7f

Please sign in to comment.