fsi-open/datasource — pull request #23 by stanislavprokopov (2013-07-05 10:31:35+00:00)
Title: Issue #22: Boolean field type

Added boolean field type and tests.

The only sketchy thing i see is the `buildCriteria` and `buildQuery` functions.

A custom `buildCriteria` is needed to typecast the incoming value so that the comparison works and pass the `if (empty($data))` check.
The `buildQuery` is needed to pass the `if (empty($data) && ($data !== 0))` check in case the data is actually boolean.

It could be better to rewrite the `getCleanParameter` function and make the `if (empty($data) && ($data !== 0))` checks in it, and in case the check fails return `null`, and in the `buildQuery` only check to see if `getCleanParameter` return `null` or not. This will also allow to typecast or mess with the parameter in any other way.