#15 documentation for is{field} for bools is misleading

Sandy Smith

In generated object (datatype) classes, boolean fields
get both a direct accessor that returns the stored
database value (0,1) and an is{fieldname} accessor that
returns a boolean type.

The documentation claims that is checks if the database
value is "non-zero", that is, if it is anything but
zero. However, it actually checks if it evaluates to
true, which is different than non-zero in PHP. Empty
values ('' or NULL) in the database will also evaluate
to false, not simply zero.

The docco should read "checks if it evaluates to false
(same logic as PHP's empty() function)".


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks